<template>
  <div class="Terminal_box" ref="boxTheSize" :style="{'height':'100%','overflow-y':'scroll'}">
    <el-row>
      <!-- 左边布局 -->
      <el-col :span="4">
        <div class="grid-content bg-purple BgColor" :style="{'height':'100%'}">
          <div class="Terminal_tree" style="padding-bottom:50px;">
            <div class="tree_btn" style="height:10vh">
              <!-- <el-tooltip class="item" effect="dark" content="发布节目" placement="top"> -->
                <el-button @click="ReleaseProgramBtn" v-if="Invoking.forFunctionCode('publishRecord:publishProg')">
                  <img src="../../assets/images/zhong15_03.png" alt />
                  <div>发布节目</div>
                </el-button>
              <!-- </el-tooltip> -->
              <!-- <el-tooltip class="item" effect="dark" content="查看节目" placement="top"> -->
                <el-button @click="lookTerminalTable" v-if="Invoking.forFunctionCode('publishRecord:selectPage')">
                  <img src="../../assets/images/zhong16_03.png" alt />
                   <div>查看节目</div>
                </el-button>
              <!-- </el-tooltip> -->
              <!-- <el-tooltip class="item" effect="dark" content="下刊" placement="top"> -->
                <el-button @click="TheIssueOfClick" v-if="Invoking.forFunctionCode('publishRecord:progDownForProg')">
                  <img src="../../assets/images/zhong17_03.png" alt />
                   <div>下刊</div>
                </el-button>
              <!-- </el-tooltip> -->
            </div>
            <div
              style="overflow:auto;height:70vh;border-radius: 6px;padding: 6px;background-color: #cce3f9;"
              class="scrollber"
            >
              <!-- <el-tree
                :data="data"
                accordion
                highlight-current
                :props="defaultProps"
                node-key="data"
                class="scrollber"
                :default-expanded-keys="[0]"
                @node-click="checkChangeTree"
              >
                <span class="span-ellipsis" slot-scope="{ node}">
                  <span :title="node.label">{{ node.label }}</span>
                </span>
              </el-tree> -->
                <zycm-tree :zyTreeData="data" @zyClickTree="checkChangeTree"></zycm-tree>
            </div>
          </div>
        </div>
      </el-col>
      <!-- 右边布局 -->
      <el-col :span="20">
        <div class="grid-content bg-purple-light" style="padding-left:1.5%;">
          <div class="tltle_box">
            <div class="tltle_box_btn">
                <el-button @click="resetClick" v-if="Invoking.forFunctionCode('mediaAttribute:clientRestart')">
                  <img src="../../assets/images/zhong11_03.png" alt />
                  <div>重启</div>
                </el-button>

                <el-button @click="clearScratchFile" v-if="Invoking.forFunctionCode('mediaAttribute:deleteClientFile')">
                  <img src="../../assets/images/zhong5_03.png" alt />
                  <div>清理过期文件</div>
                </el-button>
                <el-button @click="SplitScreenClick('ji')" v-if="Invoking.forFunctionCode('mediaAttribute:activeMedia')">
                  <img src="../../assets/images/zhong4_03.png" alt />
                  <div>激活</div>
                </el-button>
                <el-button @click="showFtpSwitchover" v-if="Invoking.forFunctionCode('mediaAttribute:changeFtp')">
                  <img src="../../assets/images/zhong3_03.png" alt />
                  <div>切换FTP</div>
                </el-button>

              <el-dropdown @command="commandTarget" v-if="Invoking.ifFunctionCode('mediaAttribute:openScreen#mediaAttribute:closeScreen#mediaAttribute:mediaUpgrade')">
                <el-button type="primary" style="color:#409EFF;font-size:18px">
                  <i class="el-icon-arrow-down"></i>
                </el-button>
                <el-dropdown-menu slot="dropdown">

                  <el-dropdown-item @click.native="upgradeTerminal" v-if="Invoking.forFunctionCode('mediaAttribute:mediaUpgrade')">升级</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </div>
          </div>
          <div class="Terminal_table">
            <div class="Terminal_table_input" style="width: 100%">
              <el-row style="width: 95%">
                <el-col :span="12" style="display:flex">
                  <el-input
                    placeholder="请输入关键字"
                    v-model="searchInput"
                    @clear="searchInputText(1)"
                    clearable
                  ></el-input>
                  <div class="button1">
                    <el-button type="primary" icon="el-icon-search" @click="searchInputText(1)">搜索</el-button>
                  </div>
                  <div>
                  <el-switch
                  @change="changeSwitch"
                  v-model="advanced.switch"
                  active-color="#13ce66"
                  inactive-color="#ff4949"
                  style=" margin:12px 20px 0;width:106px"
                  active-text="实时刷新"
                ></el-switch>
                  </div>
                </el-col>
                <el-col :span="8" :offset="4">
                  <div class="onlineData">
                    <span>
                      在线数：
                      <span style="color:#f9a174;">{{tableData.onClient}}</span>
                    </span>
                    <span>
                      离线数：
                      <span style="color:#f9a174;">{{tableData.offClient}}</span>
                    </span>
                    <span>
                      总 数：
                      <span style="color:#f9a174;">{{tableData.totalClient}}</span>
                    </span>
                  </div>
                </el-col>
              </el-row>
            </div>
            <div class="refresh_box">
              <el-button class="refresh" @click="advanceDsearchTrue">高级搜索</el-button>
              <div class="refreshFor">
                <el-tooltip
                  v-for="(item,key,index) in advanceSearchList"
                  placement="top"
                  :key="index"
                  v-if="item"
                >
                  <div slot="content">{{item}}</div>
                  <el-tag closable @close="closableTag(key)">
                    <span class="refreshFor_li_text">{{item}}</span>
                  </el-tag>
                </el-tooltip>
              </div>
            </div>
            <zycm-table
              @zyLoadData="loadData"
              zy-table-ref="terminal_publish_table"
              :zy-table-data="tabledataList"
              zy-table-height="55vh"
              zy-table-select-type="checkbox"
              zy-row-key="mid"
              @zyTableSelect="tableSelect"
            >
               <el-table-column type="expand" slot="expand">
                <template slot-scope="scope">
                  <el-form label-position="left" inline class="demo-table-expand fold">
                    <el-form-item label="I C C I D:">
                      <span>{{scope.row.iccid}}</span>
                      <span v-show="scope.row.cardStatus==1">[可激活]</span>
                      <span v-show="scope.row.cardStatus==2">[可测试]</span>
                      <span v-show="scope.row.cardStatus==3">[已激活]</span>
                      <span v-show="scope.row.cardStatus==4">[已停用]</span>
                      <span v-show="scope.row.cardStatus==5">[失效]</span>
                      <span v-show="scope.row.cardStatus==6">[库存]</span>
                    </el-form-item>
                    <el-form-item label="网络类型:">
                      <span v-show="scope.row.netType==1">{{'物联网'}}</span>
                      <span v-show="scope.row.netType==2">{{'兴旺网'}}</span>
                      <span v-show="scope.row.netType==3">{{'私有网'}}</span>
                      <span v-show="scope.row.netType==4">{{'公网'}}</span>
                      <span v-show="scope.row.iotType==1">[电信]</span>
                      <span v-show="scope.row.iotType==2">[联通]</span>
                      <span v-show="scope.row.iotType==3">[移动]</span>
                    </el-form-item>
                    <el-form-item label="亮度:">
                      <span>{{scope.row.light}}</span>
                    </el-form-item>
                    <el-form-item label="剩余空间:">
                      <span>{{scope.row.diskFreeSpace}}</span>
                    </el-form-item>
                    <el-form-item label="周期用量:">
                      <span>{{scope.row.curDataUsage | convertBytes}}</span>
                    </el-form-item>
                    <el-form-item label="进 度:">
                      <span>{{scope.row.downloadProgress}}</span>
                    </el-form-item>
                    <el-form-item label="最后通信:">
                      <span>{{scope.row.lastReceiveTime | dateFormat}}</span>
                    </el-form-item>
                    <el-form-item label="网　速:">
                      <span>{{scope.row.netSpeed | convertBytes}}/s</span>
                    </el-form-item>
                    <el-form-item label="音　量:">
                      <span>{{scope.row.voice}}</span>
                    </el-form-item>
                    <el-form-item label="看门狗:">
                      <span>{{scope.row.dogVersion}}</span>
                    </el-form-item>
                    <el-form-item label="创建时间:">
                      <span>{{scope.row.createTime | dateFormat}}</span>
                    </el-form-item>
                     <el-form-item label="录屏端:">
                      <span>{{scope.row.recordScreenInfo}}</span>
                    </el-form-item>
                  </el-form>
                </template>
              </el-table-column>
              <el-table-column label="编号" prop="clientNumber" show-overflow-tooltip min-width="100"></el-table-column>
              <el-table-column label="名称" prop="clientName" show-overflow-tooltip min-width="100"></el-table-column>
              <el-table-column label="组名" prop="mediaGroupName" show-overflow-tooltip min-width="100"></el-table-column>
              <el-table-column label="状态" prop="adStatus" width="80" show-overflow-tooltip>
                <template slot-scope="props">
                  <div v-if="props.row.adStatus==0">
                    <el-tag type="danger" :size="GlobalVar.sizeSet.tag">
                      离线
                      <span v-if="props.row.videoOutMode==0">(关屏)</span>
                    </el-tag>
                  </div>
                  <div v-else-if="props.row.adStatus==1">
                    <el-tag type="success" :size="GlobalVar.sizeSet.tag">
                      在线
                      <span v-if="props.row.videoOutMode==0">(关屏)</span>
                    </el-tag>
                  </div>
                  <div v-else-if="props.row.adStatus==-1">
                    <el-tag :size="GlobalVar.sizeSet.tag">
                      拆机
                      <span v-if="props.row.videoOutMode==0">(关屏)</span>
                    </el-tag>
                  </div>
                  <div v-else-if="props.row.adStatus==-2">
                    <el-tag type="warning" :size="GlobalVar.sizeSet.tag">
                      在线异常
                      <span v-if="props.row.videoOutMode==0">(关屏)</span>
                    </el-tag>
                  </div>
                </template>
              </el-table-column>
              <el-table-column label="激活状态" prop="workStatus" width="80" show-overflow-tooltip>
                <template slot-scope="props">
                  <el-tag type="warning" v-if="props.row.workStatus==0" :size="GlobalVar.sizeSet.tag">未激活</el-tag>
                  <el-tag type="success" v-else :size="GlobalVar.sizeSet.tag">激活</el-tag>
                </template>
              </el-table-column>
              <el-table-column label="IP" prop="mediaIp" show-overflow-tooltip></el-table-column>
              <el-table-column label="节目数（终端/系统）" prop="programNum" show-overflow-tooltip>
                <template slot-scope="scope">
                  <div>
                    <span>{{!scope.row.playProgramNum?0:scope.row.playProgramNum}}/</span>
                    <span>{{!scope.row.programNum?0:scope.row.programNum}}</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column label="版本" prop="clientVersion" width="80" show-overflow-tooltip></el-table-column>
              <el-table-column label="操作"  fixed="right"  width="100" class-name="stopRowClick">
                <template slot-scope="scope">
                  <el-dropdown :size="GlobalVar.sizeSet.dropdown">
                    <el-button type="primary" :size="GlobalVar.sizeSet.btn">
                      更多
                      <i class="el-icon-arrow-down el-icon--right"></i>
                    </el-button>
                    <el-dropdown-menu slot="dropdown">
                      <el-dropdown-item @click.native="TheTerminalDetails(scope.row)" v-if="Invoking.forFunctionCode('mediaAttribute:selectByPrimaryKey')">终端详情</el-dropdown-item>
                      <el-dropdown-item @click.native="SplitScreenClick('ce',scope.row)" v-if="Invoking.forFunctionCode('mediaAttribute:testNetSpeed')">终端测速</el-dropdown-item>
                      <!-- <el-dropdown-item @click.native="monitClick(scope.row)">监播</el-dropdown-item> -->
                    </el-dropdown-menu>
                  </el-dropdown>
                </template>
              </el-table-column>
            </zycm-table>
          </div>
        </div>
      </el-col>
    </el-row>
  <!-- 终端日志详情 -->
    <el-dialog
      :title="'终端详情【'+logForm.clientNumber+'】'"
      :visible.sync="LogDetails"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      @close="closeEliminate"
      :close-on-click-modal="false"
    >
      <div class="dialog-body" style="max-height: 500px;overflow: auto;">
        <div class="line">
          <el-tabs v-model="activeName" @tab-click="handleClick" class="LogDetails">
            <el-tab-pane label="基本信息" name="first">
              <el-form ref="form" label-width="120px" :model="logForm" class="LogDetails">
                <el-form-item label="编号" width="30%" class="selectWidthInput">
                  <el-input
                    width="60%"
                    class="selectWidthInput_1"
                    disabled
                    v-model="logForm.clientNumber"
                  ></el-input>
                  <el-select v-model="logForm.netType" class="selectWidth">
                    <el-option
                      v-for="item in GlobalVar.netType"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="名称">
                  <el-input v-model="logForm.clientName"></el-input>
                </el-form-item>
                <el-form-item label="主板型号">
                  <el-input disabled v-model="logForm.hardware"></el-input>
                </el-form-item>
                <el-form-item label="分组">
                  <el-input disabled v-model="logForm.mediaGroupName"></el-input>
                </el-form-item>
                <el-form-item label="机器码">
                  <el-input disabled v-model="logForm.machineCode"></el-input>
                </el-form-item>
                <el-form-item label="当前音量">
                  <el-col :span="19">
                    <el-input v-model="logForm.voice" @blur="MaximumVolume" style="width: 100%;"></el-input>
                  </el-col>
                  <el-col :span="5" style="font-weight: 700;color:#409EFF;"> <span style="color:red;font-weight: 700;">*</span> 取值范围0~{{logForm.maxVoice}}</el-col>
                </el-form-item>
                <el-form-item label="当前亮度">
                  <el-col :span="19">
                    <el-input v-model="logForm.light" @blur="MaximumVolume" style="width: 100%;"></el-input>
                  </el-col>
                  <el-col :span="5" style="font-weight: 700;color:#409EFF;"><span style="color:red;font-weight: 700;">*</span> 取值范围0~100</el-col>
                </el-form-item>
                <el-form-item label="CPU温度">
                  <el-input disabled v-model="logForm.cpuTemp"></el-input>
                </el-form-item>
                <el-form-item label="系统版本">
                  <el-input disabled v-model="logForm.sysVersion"></el-input>
                </el-form-item>
                <el-form-item label="终端IP">
                  <el-input disabled v-model="logForm.mediaIp"></el-input>
                </el-form-item>
                <el-form-item label="终端连接">
                  <el-input disabled v-model="logForm.connectAddr"></el-input>
                </el-form-item>
              </el-form>
            </el-tab-pane>
            <el-tab-pane label="策　略" name="second">
              <el-form ref="form" :model="logForm" label-width="140px" class="LogDetails">
                <el-form-item label="FTP地址">
                  <el-select v-model="logForm.ftpId" placeholder="请选择FTP地址">
                    <el-option
                      :label="item.ipAddr+':'+item.port"
                      :value="item.ftpId"
                      v-for="(item,index) in ftpDataList"
                      :key="index"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="下载时段">
                  <el-time-picker
                    is-range
                    v-model="logForm.loadEndTime"
                    range-separator="至"
                    start-placeholder="开始时间"
                    end-placeholder="结束时间"
                    format="HH:mm:ss"
                    value-format="HH:mm:ss"
                    placeholder="选择时间范围"
                  ></el-time-picker>
                </el-form-item>
                 <el-form-item label="工作时段">
                  <el-time-picker
                    is-range
                    v-model="logForm.loadWorkTime"
                    range-separator="至"
                    start-placeholder="开始时间"
                    end-placeholder="结束时间"
                    format="HH:mm:ss"
                    value-format="HH:mm:ss"
                    placeholder="选择时间范围"
                    disabled
                  ></el-time-picker>
                </el-form-item>
                <el-form-item label="磁盘总空间">
                  <el-input disabled v-model="logForm.diskSpace"></el-input>
                </el-form-item>
                <el-form-item label="剩余空间">
                  <el-input disabled v-model="logForm.diskFreeSpace"></el-input>
                </el-form-item>
                <el-form-item label="清理过期文件间隔">
                  <el-input v-model="logForm.cleanFileDay"></el-input>
                </el-form-item>
              </el-form>
            </el-tab-pane>
            <el-tab-pane label="运行日志" name="third" v-if="Invoking.forFunctionCode('runLog:selectPage')">
              <zycm-table
                @zyLoadData="loadData"
                zy-table-ref="media_run_log_table"
                :zy-table-data="tabledataList"
                zy-table-height="300px"
                zy-border
                :zy-pager-count="5"
            >
                <el-table-column prop="logTime" label="日志时间" width="140" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <div>{{scope.row.logTime |dateFormat}}</div>
                  </template>
                </el-table-column>
                <el-table-column prop="logLevel" label="级别" width="100" show-overflow-tooltip>
                  <template slot-scope="props">
                    <el-tag type="success" v-if="props.row.logLevel==1" :size="GlobalVar.sizeSet.tag">普通</el-tag>
                    <el-tag type="danger" v-else-if="props.row.logLevel==2" :size="GlobalVar.sizeSet.tag">错误异常</el-tag>
                    <el-tag type="warning" v-else-if="props.row.logLevel==3" :size="GlobalVar.sizeSet.tag">警告</el-tag>
                    <el-tag type="success" v-else-if="props.row.logLevel==20" :size="GlobalVar.sizeSet.tag">LED普通</el-tag>
                    <el-tag type="danger" v-else-if="props.row.logLevel==21" :size="GlobalVar.sizeSet.tag">LED异常</el-tag>
                  </template>
                </el-table-column>
                <el-table-column prop="logInfo" label="日志信息" min-width="140" show-overflow-tooltip></el-table-column>
              </zycm-table>
            </el-tab-pane>
            <el-tab-pane label="播放日志" name="fourth" v-if="Invoking.forFunctionCode('playLog:selectPage')">
               <zycm-table
                @zyLoadData="loadData"
                zy-table-ref="media_play_log_table"
                :zy-table-data="tabledataList"
                zy-table-height="300px"
                zy-border
                :zy-pager-count="5"
              >
                <el-table-column prop="logDate" label="日志时间" width="140" show-overflow-tooltip></el-table-column>
                <el-table-column prop="programName" label="文件名" min-width="140" show-overflow-tooltip></el-table-column>
                <el-table-column prop="playTime" label="播放次数" width="100" show-overflow-tooltip></el-table-column>
               </zycm-table>
            </el-tab-pane>
            <el-tab-pane label="终端文件" name="file" v-if="Invoking.forFunctionCode('mediaAttribute:getClientFile')">
              <div v-if="activeName == 'file'">
                 <zycm-table
                  @zyLoadData="loadData"
                  zy-table-ref="get_client_file_table"
                  :zy-table-data="tabledataList"
                  zy-table-height="300px"
                  zy-border
                  :zy-pager-count="5"
                  zy-front-auto-page
                >
                  <el-table-column prop="materialName" label="素材名称" show-overflow-tooltip min-width="140"></el-table-column>
                  <el-table-column prop="size" label="大小" show-overflow-tooltip width="100">
                    <template slot-scope="props">
                      <div>{{props.row.size | convertBytes}}</div>
                    </template>
                  </el-table-column>
                  <el-table-column prop="fileStatus" label="状态" width="70" show-overflow-tooltip>
                    <template slot-scope="scope">
                      <div v-show="scope.row.fileStatus==0">已过期</div>
                      <div v-show="scope.row.fileStatus==1">档期中</div>
                    </template>
                  </el-table-column>
                 </zycm-table>
              </div>
            </el-tab-pane>
            <span
              style="width: 100%;text-align: center;margin: 5px auto 0;height: 50px;display: block;"
              class="button_dialog"
              v-if="Invoking.forFunctionCode('mediaAttribute:updateMedia')"
            >
              <el-button
                style="background-color:#4d9ce0;color:#fff"
                v-show="activeName=='first'||activeName=='second'"
                @click="UpTerminalLogDetails"
              >确 定</el-button>
            <!--   <el-button
                style="background-color:#4d9ce0;color:#fff"
                v-show="activeName=='file'&& query1.total"
                @click="scratchFile"
              >清理过期文件</el-button> -->
              <el-button
                @click="LogDetails=false"
                v-show="activeName=='first'||activeName=='second'"
              >取 消</el-button>
            </span>
          </el-tabs>
        </div>
      </div>
    </el-dialog>
    <!-- 物联卡信息设置 -->
    <!-- <el-dialog
      :title="'终端【'+logForm.clientNumber+'】物联卡信息'"
      :visible.sync="aa"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      @close="closeEliminate"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
            <el-form ref="form" label-width="120px" :model="logForm" class="LogDetails">
              <el-form-item label="编号" width="30%" class="selectWidthInput">
                <el-input
                  width="60%"
                  class="selectWidthInput_1"
                  disabled
                  v-model="logForm.clientNumber"
                ></el-input>
                <el-select v-model="logForm.netType" class="selectWidth">
                  <el-option
                    v-for="item in GlobalVar.netType"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="名称">
                <el-input v-model="logForm.clientName"></el-input>
              </el-form-item>
              <el-form-item label="主板型号">
                <el-input disabled v-model="logForm.hardware"></el-input>
              </el-form-item>
              <el-form-item label="分组">
                <el-input disabled v-model="logForm.mediaGroupName"></el-input>
              </el-form-item>
              <el-form-item label="机器码">
                <el-input disabled v-model="logForm.machineCode"></el-input>
              </el-form-item>
              <el-form-item label="当前音量">
                <el-input v-model="logForm.voice" @blur="MaximumVolume"></el-input>
              </el-form-item>
              <el-form-item label="当前亮度">
                <el-input v-model="logForm.light" @blur="MaximumVolume"></el-input>
              </el-form-item>
              <el-form-item label="CPU温度">
                <el-input disabled v-model="logForm.cpuTemp"></el-input>
              </el-form-item>
              <el-form-item label="系统版本">
                <el-input disabled v-model="logForm.sysVersion"></el-input>
              </el-form-item>
              <el-form-item label="终端IP">
                <el-input disabled v-model="logForm.mediaIp"></el-input>
              </el-form-item>
              <el-form-item label="终端连接">
                <el-input disabled v-model="logForm.connectAddr"></el-input>
              </el-form-item>
            </el-form>

            <span
              style="width: 100%;text-align: center;margin: 5px auto 0;height: 50px;display: block;"
              class="button_dialog"
              v-if="Invoking.forFunctionCode('mediaAttribute:updateMedia')"
            >
              <el-button
                style="background-color:#4d9ce0;color:#fff"
                v-show="activeName=='first'||activeName=='second'"
                @click="UpTerminalLogDetails"
              >确 定</el-button>

              <el-button
                @click="LogDetails=false"
                v-show="activeName=='first'||activeName=='second'"
              >取 消</el-button>
            </span>

        </div>
      </div>
    </el-dialog> -->

    <!-- 查看XXXX终端组的节目 -->
    <el-dialog
      :title="'查看【'+groupData.label+'】的'+(showSyncGroupProgBtn===1?'原有':'主同步组【'+masterGroupName+'】')+'节目'"
      :visible.sync="lookProgram"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
      @close="closeEliminate"
    >
      <div class="dialog-body">
        <div class="line">
          <div class="TerminalHead">
             <el-button @click="switchProgramListBtn" v-if="masterGroupId">
                <!-- <img src="../../assets/images/zhong17_03.png" alt /> -->
                <i class="el-icon-document-copy" style="font-size: 26px;color: #67C23A;"></i>
                <div v-if="showSyncGroupProgBtn===1" >查看同步节目</div>
                <div v-if="showSyncGroupProgBtn===0"> 查看原有节目</div>
              </el-button>
              <el-button @click="ReleaseProgramBtn" v-if="Invoking.forFunctionCode('publishRecord:publishProg') && showSyncGroupProgBtn===1">
                <img src="../../assets/images/zhong17_03.png" alt />
                <div>发布</div>
              </el-button>
              <el-button @click="clearScratchFile" v-if="Invoking.forFunctionCode('publishRecord:progDownForGroup') && showSyncGroupProgBtn===1">
                <img src="../../assets/images/zhong15_03.png" alt />
                <div>下刊</div>
              </el-button>
              <el-button @click="DeriveTerminalGroups" @close="isFinish=[]" v-if="Invoking.forFunctionCode('export:exportZIPByMediaGroupId') && showSyncGroupProgBtn===1">
                <a
                  :href="flagHerf?this.$http.defaults.baseURL+'export/exportZIPByMediaGroupId?zycmToken='+this.token+'&mediaGroupId='+this.groupData.data+'&uuid='+this.uuid:'javascript:;'"
                  download
                  target='_blank'
                >
                   <!-- :target="'_blank'" -->
                  <img src="../../assets/images/wei2_03.png" alt />
                  <div>导出</div>
                </a>
              </el-button>
          </div>
          <!-- <div>{{flagHerf}}</div> -->
          <zycm-table
              @zyLoadData="loadData"
              zy-table-ref="media_group_prog_table"
              :zy-table-data="tabledataList"
              zy-table-height="300px"
              zy-table-select-type="checkbox"
              @zyTableSelect="tableSelect"
              zy-border
              zy-row-key="publishId"
          >
            <el-table-column type="expand" slot="expand">
              <template slot-scope="scope">
                <el-form
                  label-position="left"
                  inline
                  class="demo-table-expand fold"
                  style="padding: 5px 5px 5px 20px;"
                >
                  <el-form-item label="大小:">
                    <span>{{scope.row.totalSize}}</span>
                  </el-form-item>
                  <el-form-item label="时长:">
                    <span>{{scope.row.totalPlayTime+'s'}}</span>
                  </el-form-item>
                  <el-form-item label="播放优先级:" style="width:200px">
                    <span v-show="scope.row.playLevel==1">{{'普通节目'}}</span>
                    <span v-show="scope.row.playLevel==2">{{'优先节目'}}</span>
                  </el-form-item>
                  <el-form-item label="播放策略:">
                    <span v-show="scope.row.timeMode==1">永久</span>
                    <span v-show="scope.row.timeMode==2">按时间段</span>
                    <span v-show="scope.row.timeMode==3">按星期</span>
                    <span v-show="scope.row.timeMode==4">定时连播</span>
                  </el-form-item>
                  <el-form-item label="起止时间:">
                    <span>{{scope.row.playStartDate?scope.row.playStartDate:''}}</span>
                    <span>&nbsp;{{scope.row.playStartTime?scope.row.playStartTime:''}}</span>
                    <span>&nbsp;至&nbsp;</span>
                    <span>{{scope.row.playEndDate?scope.row.playEndDate:''}}</span>
                    <span>&nbsp;{{scope.row.playEndTime?scope.row.playEndTime:''}}</span>
                  </el-form-item>
                </el-form>
              </template>
            </el-table-column>
            <el-table-column label="节目名称" prop="programName" min-width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="发布时间" prop="createTime" show-overflow-tooltip>
              <template slot-scope="scope">
                <div>{{scope.row.createTime | dateFormat}}</div>
              </template>
            </el-table-column>
            <el-table-column label="状态" prop="publishStatus"  width="70" show-overflow-tooltip>
              <template slot-scope="scope">
                <el-tooltip placement="top" effect="dark" >
                  <div slot="content" style="width:300px;" v-html="showUnionTime(scope.row)"></div>
                  <div>
                    <div v-show="scope.row.publishStatus==0">未到档期</div>
                    <div v-show="scope.row.publishStatus==1">档期中</div>
                    <div v-show="scope.row.publishStatus==2">已过期</div>
                    {{scope.row.unionTimeLength > 19?"(多时段)":""}}
                  </div>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column label="发布人" prop="userName" width="70" show-overflow-tooltip></el-table-column>
            <el-table-column label="操作" width="100" class-name="stopRowClick">
              <template slot-scope="scope">
                <el-dropdown :size="GlobalVar.sizeSet.dropdown">
                  <el-button type="primary" :size="GlobalVar.sizeSet.btn">
                    更多
                    <i class="el-icon-arrow-down el-icon--right"></i>
                  </el-button>
                  <el-dropdown-menu slot="dropdown" style="width:80px;">
                    <el-dropdown-item @click.native="showPopover(scope.row)" >详情</el-dropdown-item>
                    <el-dropdown-item @click.native="moveUpClick(scope,'up')" v-if="Invoking.forFunctionCode('publishRecord:updateProgramOrderByKey')">上移</el-dropdown-item>
                    <el-dropdown-item @click.native="moveUpClick(scope,'down')" v-if="Invoking.forFunctionCode('publishRecord:updateProgramOrderByKey')">下移</el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </template>
            </el-table-column>
          </zycm-table>
          <span
            style="width: 100%;text-align: center;margin: 0 auto;height: 50px;display: block;"
            class="button_dialog"
          >
            <el-button
            v-if="Invoking.forFunctionCode('publishRecord:publishProgByGroup') && showSyncGroupProgBtn===1"
              style="background-color:#4d9ce0;color:#fff;border-radius: 5px;"
              @click="synchronization"
            >同步节目排序</el-button>
          </span>
        </div>
      </div>
    </el-dialog>
    <!-- 节目发布 -->
    <el-dialog
      title="节目发布"
      :visible.sync="ProgramReleased"
      :width="this.$store.getters.offsetWidth"
      @close="closeEliminate"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
          <el-steps :active="active" align-center style="box-shadow: 1px 5px 5px #ccc9c9;">
            <el-step title="选择节目">
              <div slot="title">
                选择节目
                <el-badge class="mark" :value="ProgramSelectList.length" />
              </div>
            </el-step>
            <el-step title="选择终端组">
              <div slot="title">
                选择终端组
                <el-badge class="mark" :value="TreeArraySize" />
              </div>
            </el-step>
            <el-step title="播放设置"></el-step>
          </el-steps>
          <!-- 第一阶段 -->
          <div class="step_select" v-show="!showReleased1">
            <div class="tltle_box_input">
              <el-input
                placeholder="请输入节目名称关键字"
                v-model="ProgramSearchdata"
                @clear="clearInputText"
                clearable
              ></el-input>
              <div class="input_button">
                <el-button type="primary" icon="el-icon-search" @click="searchInputText(2)">搜索</el-button>
              </div>
            </div>
            <div style="width: 100%;">
              <zycm-table
              @zyLoadData="loadData"
              zy-table-ref="dialog_prog_select_publish_table"
              :zy-table-data="tabledataList"
              zy-table-height="290px"
              zy-table-select-type="checkbox"
              @zyTableSelect="tableSelect"
              zy-border
            >
                <el-table-column label="节目名称" prop="programName" min-width="200" show-overflow-tooltip>
                </el-table-column>
                <el-table-column prop="totalSize" label="大小" width="100">
                  <template slot-scope="scope">
                     <el-popover
                      trigger="hover"
                      placement="top"
                      @show="showPopoverRow1(scope.row)"
                      @hide="division = 0"
                    >
                      <div
                        class="boxLayou"
                        :style="{'width':parseFloat(scope.row.programWidth / division)+'px','height':parseFloat(scope.row.programHeight / division)+'px'}"
                      >
                        <div
                          v-for="(t,i) in layoutData"
                          :key="i"
                          :style="{'width':t.width+'px','height':t.height+'px','left':t.x+'px','top':t.y+'px','line-height':t.height+'px'}"
                          class="boxLayou_child"
                        >{{t.areaInfo}}</div>
                      </div>
                      <div slot="reference">
                        <div>{{scope.row.totalSize}}</div>
                      </div>
                    </el-popover>
                    <!--  <el-popover
                      v-if="layoutData"
                      trigger="hover"
                      placement="top"
                      @show="showPopoverRow1(scope.row)"
                      @hide="division = 0"
                    >
                      <div
                        class="boxLayou"
                        :style="{'width':parseFloat(scope.row.programWidth / division)+'px','height':parseFloat(scope.row.programHeight / division)+'px'}"
                      >
                        <div
                          v-for="(t,i) in layoutData"
                          :key="i"
                          :style="{'width':t.width+'px','height':t.height+'px','left':t.x+'px','top':t.y+'px','line-height':t.height+'px'}"
                          class="boxLayou_child"
                        >{{t.areaInfo}}</div>
                      </div>
                      <div slot="reference" class="name-wrapper">
                        <div>{{scope.row.totalSize}}</div>
                      </div>
                    </el-popover> -->
                  </template>
                </el-table-column>
                <el-table-column prop="totalPlayTime" label="时长(秒)" width="60" show-overflow-tooltip></el-table-column>
                <el-table-column label="节目宽高" show-overflow-tooltip>
                  <template slot-scope="props">
                    <!-- <div>{{scope.row.programWidth+'*'+scope.row.programHeight }}</div> -->
                    <div
                      v-if="props.row.programWidth >= props.row.programHeight"
                    >{{props.row.programWidth+'*'+props.row.programHeight}}(横屏)</div>
                    <div v-else>{{props.row.programWidth+'*'+props.row.programHeight}}(竖屏)</div>
                  </template>
                </el-table-column>
                <el-table-column prop="creator" label="创建人" show-overflow-tooltip></el-table-column>
                <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip>
                  <template slot-scope="scope">
                    <div>{{scope.row.createTime | dateFormat}}</div>
                  </template>
                </el-table-column>
              </zycm-table>
            </div>
          </div>
          <!-- 第二阶段 -->
          <div v-show="showReleased2">
            <div style="width: 100%;height:400px;overflow-y:scroll">
              <!-- <el-tree
                :data="data"
                ref="treeCheck"
                accordion
                show-checkbox
                node-key="data"
                :props="defaultProps"
                :default-expanded-keys="[0]"
                :default-checked-keys="childrenNode"
                @check="checkChange"
              ></el-tree> -->
              <zycm-tree ref="treeCheck" :strictlyData="false" :zyTreeData="data1" @zyChenckTree="checkChange"></zycm-tree>
            </div>
          </div>
          <!-- 第三阶段 -->
          <div v-show="showReleased3" style="position: relative;overflow: hidden;height: 400px;">
            <div class="thirdlyPhase">
              <span>播放日期</span>
              <el-tabs @tab-click="tabClickProgram" v-model="Releaseprogram.activeNameProgram">
                <el-tab-pane label="按时间段" name="time">
                  <div class="byTime">
                    <el-radio-group v-model="flagPerpetuaChange">
                      <el-radio-button :label="true">永久播放</el-radio-button>
                      <el-radio-button :label="false">按时间段</el-radio-button>
                    </el-radio-group>
                    <div style="margin-left: 10px;">
                      <el-date-picker
                        v-model="Releaseprogram.timeQuantum"
                        @change="changeTimeQuantum"
                        type="daterange"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                        value-format="yyyy-MM-dd"
                        :disabled="Releaseprogram.flagPerpetua"
                      ></el-date-picker>
                    </div>
                  </div>
                </el-tab-pane>
                <el-tab-pane label="定时连播" name="frame">
                  <div>
                    <el-date-picker
                      v-model="Releaseprogram.timeQuantum"
                      type="daterange"
                      range-separator="至"
                      start-placeholder="开始日期"
                      end-placeholder="结束日期"
                      value-format="yyyy-MM-dd"
                    ></el-date-picker>
                  </div>
                </el-tab-pane>
                <el-tab-pane label="按星期" name="week" v-if="false"><!-- 未完成功能先隐藏 -->
                  <ul class="program_ul" ref="program_ul">
                    <li
                      ref="program_num"
                      v-for="(item,index) in hebdomad"
                      :key="index"
                      @click="ClickHebdomad(index)"
                    >{{item}}</li>
                  </ul>
                </el-tab-pane>
              </el-tabs>
              <div class="palyTime">播放时间</div>
              <div class="Select_Option">
                <el-select @change="changePalyRankVal" v-model="Releaseprogram.palyRankVal">
                  <el-option v-for="item in palyRank" :key="item" :label="item" :value="item"></el-option>
                </el-select>
                <el-select v-model="Releaseprogram.tiemSettingVal">
                  <el-option v-for="item in tiemSetting" :key="item" :label="item" :value="item"></el-option>
                </el-select>
                <div class="frequency" @click="show2 = !show2">
                  按频率播放设置
                  <el-badge :value="palyTiemTable.length" style="margin-right: 5px;" />
                  <i class="el-icon-arrow-right" v-if="!show2"></i>
                  <i class="el-icon-arrow-down" v-else></i>
                </div>
              </div>
              <transition name="el-zoom-in-top">
                <div v-show="show2" class="transition-box">
                  <div class="hebdomad_head">
                    <div>
                      <el-time-picker
                        is-range
                        v-model="Releaseprogram.hhmmss"
                        range-separator="至"
                        start-placeholder="开始时间"
                        end-placeholder="结束时间"
                        placeholder="选择时间范围"
                        value-format="HH:mm:ss"
                      ></el-time-picker>
                    </div>
                    <div class="selectTiem">
                      每
                      <input type="text" v-model.number="Releaseprogram.palyDuration" />分钟，播放
                      <input type="text" v-model.number="Releaseprogram.several" />次
                    </div>
                    <el-button
                      type="primary"
                      @click="confirmAdd"
                      v-if="Releaseprogram.palyRankVal=='普通'"
                      :size="GlobalVar.sizeSet.btn"
                    >添加</el-button>
                    <el-button @click="confirmClean" v-if="Releaseprogram.palyRankVal=='普通'" :size="GlobalVar.sizeSet.btn">清空</el-button>
                  </div>
                  <el-table
                    ref="zdxxTab"
                    :data="palyTiemTable"
                    border
                    stripe
                    style="width: 100%"
                    height="200px"
                    :size="GlobalVar.sizeSet.table"
                  >
                    <el-table-column type="index" label="序号" width="50"></el-table-column>
                    <el-table-column prop="begin" label="开始时间" min-width="100" show-overflow-tooltip></el-table-column>
                    <el-table-column prop="finish" label="结束时间" min-width="100" show-overflow-tooltip></el-table-column>
                    <el-table-column prop="Number1" label="次数" width="80" show-overflow-tooltip>
                      <template slot-scope="scope">
                        <div>{{scope.row.Number1==0?'不限次':scope.row.Number1}}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="Number1" label="操作" width="100">
                      <template slot-scope="scope">
                        <el-button
                          type="primary"
                          plain
                          @click="RemovePalyTiem(scope)"
                          :size="GlobalVar.sizeSet.btn"
                        >删除</el-button>
                      </template>
                    </el-table-column>
                  </el-table>
                </div>
              </transition>
            </div>
          </div>
          <span
            style="width: 100%;text-align: center;margin:15px auto 0;height: 50px;display: block;"
            class="button_dialog1"
          >
            <el-button v-show="active!==1" @click="LastStepTerminal">上一步</el-button>
            <el-button
              style="background-color:#4d9ce0;color:#fff"
              @click="NextStepTerminal"
              v-show="active!==3"
            >下一步</el-button>
            <el-button
              style="background-color:#4d9ce0;color:#fff"
              @click="ensureIssue"
              v-show="active==3"
            >确定发布</el-button>
          </span>
        </div>
      </div>
      <!-- 查看发布时出现冲突的时间段 -->
      <el-dialog
        :title="'存在时间段冲突的数据'+conflictTimeList.length+'条'"
        :visible.sync="conflictTimeList.length>0?true:false"
        width="600px"
        v-dialogDrag
        ref="dialog__wrapper"
        :close-on-click-modal="false"
        @close="conflictTimeList=[]"
        append-to-body
      >
        <el-table
          ref="tableConflictTimeList"
          :data="conflictTimeList"
          border
          stripe
          style="width: 100%"
          height="290px"
          :size="GlobalVar.sizeSet.table"
        >
          <el-table-column type="index" label="序号" width="50"></el-table-column>
          <el-table-column prop="mediaGroupName" label="组名称" min-width="100" show-overflow-tooltip></el-table-column>
          <el-table-column prop="programName" label="节目名称" min-width="100" show-overflow-tooltip></el-table-column>
          <el-table-column prop="timeMode" label="播放模式" show-overflow-tooltip>
            <template slot-scope="scope">
              <div v-if="scope.row.timeMode==1">永久</div>
              <div v-else-if="scope.row.timeMode==2">按时间段</div>
              <div v-else-if="scope.row.timeMode==3">按星期</div>
              <div v-else-if="scope.row.timeMode==4">定时连播</div>
            </template>
          </el-table-column>
          <el-table-column label="起止时间" show-overflow-tooltip>
            <template slot-scope="scope">
              <div
                v-if="scope.row.playStartDate == null && scope.row.startTime == null && scope.row.playEndDate == null && scope.row.endTime == null"
              ></div>
              <div
                v-else
              >{{scope.row.playStartDate+" "+scope.row.startTime+" 至 "+scope.row.playEndDate+" "+scope.row.endTime}}</div>
            </template>
          </el-table-column>
          <el-table-column label="次数" show-overflow-tooltip width="80">
            <template slot-scope="scope">
              <div v-if="scope.row.frequency == 0">0(不限次)</div>
              <div v-else>{{scope.row.frequency}}</div>
            </template>
          </el-table-column>
        </el-table>
      </el-dialog>
    </el-dialog>

    <!-- 查看XXXX终端组的节目 -->
    <el-dialog
      title="节目详细信息"
      :visible.sync="detailed"
      :width="this.$store.getters.offsetWidth"
      class="detailed"
      :pager-count="5"
      @close="query1.page=1;activeShow='layout'"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
          <div>
            <el-tabs v-model="activeShow">
              <el-tab-pane label="布 局" name="layout">
                <div class="TabLayout">
                  <div class="box" v-if="this.detailed && programIdData.program">
                    <div
                      class="boxLayou"
                      :style="{'width':parseFloat(programIdData.program.programWidth / division)+'px','height':parseFloat(programIdData.program.programHeight / division)+'px'}"
                    >
                      <div
                        v-for="(t,i) in programIdData.layout"
                        :key="i"
                        :style="{'width':t.width+'px','height':t.height+'px','left':t.x+'px','top':t.y+'px','line-height':t.width<35?'':t.height+'px'}"
                        class="boxLayou_child"
                        :title="t.areaInfo"
                      >{{t.areaInfo}}</div>
                    </div>

                  </div>
                </div>
              </el-tab-pane>
              <el-tab-pane label="播放文件" name="paly">
                 <zycm-table
                    @zyLoadData="loadData"
                    zy-table-ref="fb_prog_material_table"
                    :zy-table-data="tabledataList"
                    zy-table-height="250px"
                    :zy-page="false"
                    zy-border
                  >
                  <el-table-column prop="materialName" label="素材名称" min-width="100" show-overflow-tooltip></el-table-column>
                  <el-table-column prop="areaId" label="区域ID" width="60" show-overflow-tooltip></el-table-column>
                  <el-table-column prop="width" label="宽高" width="80" show-overflow-tooltip>
                    <template slot-scope="props">
                      <div v-if="!props.row.width && !props.row.height"></div>
                      <div
                        v-else
                      >{{props.row.width?props.row.width:0}}*{{props.row.height?props.row.height:0}}</div>
                    </template>
                  </el-table-column>
                  <el-table-column prop="playTime" label="时长" width="50" show-overflow-tooltip>
                    <template slot-scope="props">
                      <div v-if="!props.row.playTime"></div>
                      <div v-else>{{(props.row.playTime?props.row.playTime:0)+"s"}}</div>
                    </template>
                  </el-table-column>
                  <el-table-column prop="auditStatus" label="审核状态" width="90" show-overflow-tooltip>
                    <template slot-scope="props" v-if="props.row.type !==0">
                      <el-tag v-if="props.row.auditStatus==0" :size="GlobalVar.sizeSet.tag">未审核</el-tag>
                      <el-tag type="success" v-else-if="props.row.auditStatus==1" :size="GlobalVar.sizeSet.tag">审核通过</el-tag>
                      <el-tag type="danger" v-else :size="GlobalVar.sizeSet.tag">审核未通过</el-tag>
                    </template>
                  </el-table-column>
                  <el-table-column label="预览" width="60" show-overflow-tooltip>
                    <template slot-scope="props">
                      <el-button style="fontSize:18px;" type="primary" icon="el-icon-view" circle @click="previewProgram(props.row)" :size="GlobalVar.sizeSet.btn" ></el-button>

                      <!-- <el-button
                        style="padding:10px 6px"
                        type="primary"
                        circle
                        @click="previewProgram(props.row)"
                      >
                        <img src="../../assets/images/yan2_03.png" alt />
                      </el-button> -->
                    </template>
                  </el-table-column>
                 </zycm-table>
              </el-tab-pane>
              <el-tab-pane label="发布终端" name="publish">
                 <zycm-table
                    @zyLoadData="loadData"
                    zy-table-ref="prog_to_media_group_table"
                    :zy-table-data="tabledataList"
                    zy-table-height="250px"
                    :zy-pager-count="5"
                    zy-border
                  >
                  <el-table-column prop="mediaGroupName" label="终端组" min-width="100" show-overflow-tooltip></el-table-column>
                  <el-table-column prop="publishStatus" label="状态"  width="80" show-overflow-tooltip>
                    <template slot-scope="props" v-if="props.row.type !==0">
                      <el-tag v-if="props.row.publishStatus==0" :size="GlobalVar.sizeSet.tag">未到档期</el-tag>
                      <el-tag type="success" v-else-if="props.row.publishStatus==1" :size="GlobalVar.sizeSet.tag">档期中</el-tag>
                      <el-tag type="danger" v-else :size="GlobalVar.sizeSet.tag">已过期</el-tag>
                    </template>
                  </el-table-column>
                  <el-table-column prop="playStartDate" label="开始时间" width="140" show-overflow-tooltip>
                    <template slot-scope="props">
                      <span>
                        {{props.row.playStartDate?props.row.playStartDate+' ':''}}
                        {{props.row.playStartTime?props.row.playStartTime:''}}
                      </span>
                    </template>
                  </el-table-column>
                  <el-table-column prop="playEndDate" label="结束时间" width="140" show-overflow-tooltip>
                    <template slot-scope="props">
                      <span>
                        {{props.row.playEndDate?props.row.playEndDate+' ':''}}
                        {{props.row.playEndTime?props.row.playEndTime:''}}
                      </span>
                    </template>
                  </el-table-column>
                  <el-table-column prop="publisher" label="发布人" show-overflow-tooltip></el-table-column>
                 </zycm-table>
              </el-tab-pane>
            </el-tabs>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 升级 -->
    <el-dialog
      title="查看安装包信息"
      :visible.sync="upgradeDialog"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
          <zycm-table
                @zyLoadData="loadData"
                zy-table-ref="select_apk_table"
                :zy-table-data="tabledataList"
                zy-table-height="300px"
                zy-table-select-type="radio"
                zy-border
                @zyCellClick="zyCellClick"
                :zy-pager-count="5"
            >
            <el-table-column label="素材名" prop="materialName" min-width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="版本号" prop="apkVersion" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column label="大小" prop="size" width="80" show-overflow-tooltip></el-table-column>
            <el-table-column label="上传者" prop="creator"  width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="上传日期" prop="uploadTime" show-overflow-tooltip>
              <template slot-scope="scope">
                <div>{{scope.row.uploadTime | dateFormat}}</div>
              </template>
            </el-table-column>
            <el-table-column label="状态" prop="isPrivate" width="80" show-overflow-tooltip>
              <template slot-scope="scope">
                <div v-show="scope.row.isPrivate==0">共享</div>
                <div v-show="scope.row.isPrivate==1">不共享</div>
              </template>
            </el-table-column>
          </zycm-table>
          <span
            style="width: 100%;text-align: center;margin: 0 auto;height: 50px;display: block;"
            class="button_dialog"
          >
            <el-button style="background-color:#4d9ce0;color:#fff" @click="SubmitTheUpdates">确 定</el-button>
            <el-button @click="upgradeDialog=false">取 消</el-button>
          </span>
        </div>
      </div>
    </el-dialog>
    <!-- 展示截图弹框 -->
    <el-dialog
      title="截屏展示"
      :visible.sync="screenshotShow"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line" style="height: 500px;overflow: auto;display: flex;justify-content: space-between;flex-wrap: wrap;">
          <!-- <div style="text-align: center;padding: 20px 0;" v-if="screenshotList.length==0">加载中...</div> -->
          <div
          v-for="(item,index) in this.screenshotList"
          :key="index"
          v-loading="item.loading"
          :element-loading-text="item.clientName+' '+(item.loading?'加载中...':'加载超时...')"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.8)"
          style="width:48%;display:inline-block;height: 450px;margin-right:5px;"
          >
            <div style="padding:10px 25px;">{{item.clientName}}</div>
            <div style="width: 98%;height: 400px;border: 1px solid;">
            <img v-if="!item.loading" :src="item.loading?'':item.path" :alt="item.loading?'':'加载较慢单击可手动刷新图片'" @click="screenShotRefresh(item)" style="width: 100%;height: 400px;margin-left: 0px;"/>
            </div>
          </div>
         <!--  <span
            style="width: 100%;text-align: center;margin: 0 auto;height: 50px;display: block;"
            class="button_dialog"
          >
            <el-button style="background-color:#4d9ce0;color:#fff" @click="screenshotShow=false">关 闭</el-button>
          </span> -->
        </div>
      </div>
    </el-dialog>
    <!-- 下刊 -->
    <el-dialog
      title="下刊节目"
      :visible.sync="programTheIssueOf"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
      @close="closeEliminate"
    >
      <div class="dialog-body">
        <div class="line">
          <el-row>
            <el-col :span="8">
              <div class="grid-content bg-purple">
                <div style="margin:0 0 10px;">节目列表</div>
                <div style="width:100%;height:400px">
                  <!-- 搜索 -->
                  <el-row>
                    <el-col :span="14">
                      <div class="grid-content bg-purple">
                        <el-input v-model="ProgramSearch" placeholder="请输入内容"></el-input>
                      </div>
                    </el-col>
                    <el-col :span="9" style="float:right;">
                      <div class="grid-content bg-purple-light">
                        <el-select v-model="TheIssueOfSelect" @change="TheIssueOfClick('page')">
                          <el-option
                            v-for="item in screenPullDown"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                          ></el-option>
                        </el-select>
                      </div>
                    </el-col>
                  </el-row>
                  <div style="margin:10px 0 10px;">
                    <el-button type="primary" @click="TheIssueOfClick('page')">查询</el-button>
                    <el-button @click="TheIssueOfClick('empty')">清空</el-button>
                  </div>
                  <!-- 表格 -->
                  <div class="down_prog_table_div">
                  <zycm-table
                      @zyLoadData="loadData"
                      zy-table-ref="down_prog_table"
                      :zy-table-data="tabledataList"
                      zy-table-height="300px"
                      zy-table-select-type="radio"
                      zy-border
                      @zyCellClick="zyCellClick"
                      :zy-pager-count="5"
                      zy-layout="prev, next,total,sizes"
                  >
                    <el-table-column prop="programName" label="节目名称" show-overflow-tooltip min-width="100"></el-table-column>
                  </zycm-table>
                  </div>
                </div>
              </div>
            </el-col>
            <el-col :span="16">
              <div class="grid-content bg-purple-light" style="margin: 0 0 0 10px;">
                <div style="margin:0 0 10px;">节目{{downProgSelectedRow.programName?"["+downProgSelectedRow.programName+"]":""}}发布的终端组</div>
                <div>
                   <zycm-table
                      @zyLoadData="loadData"
                      zy-table-ref="down_prog_media_table"
                      :zy-table-data="tabledataList"
                      zy-table-height="400px"
                      zy-table-select-type="checkbox"
                      @zyTableSelect="tableSelect"
                      zy-border
                      :zy-pager-count="5"
                      zy-layout="prev, pager, next, total,sizes"
                  >
                    <el-table-column prop="mediaGroupName" label="终端组" min-width="100" show-overflow-tooltip></el-table-column>
                    <el-table-column prop="playStartDate" label="起止时间" show-overflow-tooltip>
                      <template slot-scope="scope">
                        <div>{{scope.row.playStartDate+'/'+scope.row.playEndDate}}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="playLevel" label="状态" width="50" show-overflow-tooltip>
                      <template slot-scope="scope">
                        <div v-show="scope.row.playLevel==1">普通</div>
                        <div v-show="scope.row.playLevel==2">优先</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="publishStatus" label="状态" width="70" show-overflow-tooltip>
                      <template slot-scope="scope">
                        <div v-show="scope.row.publishStatus==0">未到档期</div>
                        <div v-show="scope.row.publishStatus==1">档期中</div>
                        <div v-show="scope.row.publishStatus==2">已过期</div>
                      </template>
                    </el-table-column>
                   </zycm-table>
                </div>
              </div>
            </el-col>
          </el-row>
          <span
            style="width: 100%;text-align: center;margin: 0 auto;height: 50px;display: block;"
            class="button_dialog"
          >
            <el-button style="background-color:#4d9ce0;color:#fff" @click="confirmSelectIssue('down_prog')">确定下刊</el-button>
            <el-button @click="programTheIssueOf=false;">取 消</el-button>
          </span>
        </div>
      </div>
    </el-dialog>
    <!-- 展示ftp表格 -->
    <el-dialog
      title="切换FTP"
      :visible.sync="FtpSwitchover"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
          <div>
             <zycm-table
                  @zyLoadData="loadData"
                  zy-table-ref="change_ftp_table"
                  :zy-table-data="tabledataList"
                  zy-table-height="400px"
                  zy-border
                  :zy-pager-count="5"
                  @zyCellClick="zyCellClick"
                  zy-table-select-type="radio"
                  zy-page
                  zy-front-auto-page
                  @zyCleanSelectedToAutoPage="zyCleanSelectedToAutoPage"
                >
              <el-table-column prop="ipAddr" label="ftp的IP地址" min-width="100" show-overflow-tooltip></el-table-column>
              <el-table-column prop="ftpUser" label="ftp用户" width="100" show-overflow-tooltip></el-table-column>
              <el-table-column prop="port" label="端口号" width="100" show-overflow-tooltip></el-table-column>
              <el-table-column prop="isDefault" label="默认FTP" width="80">
                <template slot-scope="props">
                  <div v-if="props.row.isDefault==1">是</div>
                  <div v-if="props.row.isDefault==0">否</div>
                </template>
              </el-table-column>
             </zycm-table>
          </div>
          <span
            style="width: 100%;text-align: center;margin: 20px auto 0;height: 50px;display: block;"
            class="button_dialog"
          >
            <el-button style="background-color:#4d9ce0;color:#fff" @click="SureToModifyFtp">确 定</el-button>
            <el-button @click="FtpSwitchover=false">取 消</el-button>
          </span>
        </div>
      </div>
    </el-dialog>
    <!-- 保存节目单 -->
    <el-dialog
      title="保存节目单"
      :visible.sync="saveProgramDialog"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
          <el-form ref="form" :model="saveprogram" label-width="140px" class="LogDetails">
            <el-form-item label="节目单名称">
              <el-input v-model="saveprogram.label"></el-input>
            </el-form-item>
          </el-form>
          <span
            style="width: 100%;text-align: center;margin: 0 auto;height: 50px;display: block;"
            class="button_dialog"
          >
            <el-button style="background-color:#4d9ce0;color:#fff" @click="submitSaveLabel">确 定</el-button>
            <el-button @click="saveProgramDialog=false;">取 消</el-button>
          </span>
        </div>
      </div>
    </el-dialog>
    <!-- 导入节目单 -->
    <el-dialog
      title="导入节目单"
      :visible.sync="TheImportProgram"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
          <el-row>
            <el-col :span="8">
              <div class="grid-content bg-purple">
                <div style="margin:0 0 10px;">节目列表</div>
                <div style="width:100%;height:400px">
                  <!-- 表格 -->
                   <zycm-table
                    @zyLoadData="loadData"
                    zy-table-ref="prog_list_table"
                    :zy-table-data="tabledataList"
                    zy-table-height="400px"
                    zy-table-select-type="radio"
                    zy-layout="prev, pager, next,total"
                    @zyCellClick="zyCellClick"
                    zy-border
                  >
                    <el-table-column prop="listName" label="节目单列表" min-width="100" show-overflow-tooltip></el-table-column>
                   </zycm-table>
                </div>
              </div>
            </el-col>
            <el-col :span="16">
              <div class="grid-content bg-purple-light" style="margin: 0 0 0 10px;">
                <div style="margin:0 0 10px;">节目单中的节目</div>
                <div>
                   <zycm-table
                    @zyLoadData="loadData"
                    zy-table-ref="prog_list_detail_table"
                    :zy-table-data="tabledataList"
                    zy-table-height="400px"
                    :zy-page="false"
                    zy-border
                  >
                    <el-table-column prop="programName" label="节目名" min-width="100" show-overflow-tooltip></el-table-column>
                    <el-table-column prop="timeMode	" label="播放策略" width="70" show-overflow-tooltip>
                      <template slot-scope="scope">
                        <div v-show="scope.row.timeMode==1">永久</div>
                        <div v-show="scope.row.timeMode==2">按时间段</div>
                        <div v-show="scope.row.timeMode==3">按星期</div>
                        <div v-show="scope.row.timeMode==4">定时连播</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="playStartDate" label="起止时间" show-overflow-tooltip>
                      <template slot-scope="scope">
                        <div
                          v-show="scope.row.timeMode!==3"
                        >{{scope.row.playStartDate+" "+ scope.row.playStartTime+'/'+scope.row.playEndDate+" "+ scope.row.playEndTime}}</div>
                        <div v-show="scope.row.timeMode==3">{{scope.row.weekSet}}</div>
                      </template>
                    </el-table-column>
                    <el-table-column prop="playLevel" label="状态"  width="50" show-overflow-tooltip>
                      <template slot-scope="scope">
                        <div v-show="scope.row.playLevel==1">普通</div>
                        <div v-show="scope.row.playLevel==2">优先</div>
                      </template>
                    </el-table-column>

                    <div v-if="!this.TheImportProgram">
                      <el-table-column type="selection" width="55"></el-table-column>
                      <el-table-column type="index" width="50" label="序号"></el-table-column>
                      <el-table-column prop="mediaGroupName" label="终端组" show-overflow-tooltip min-width="100"></el-table-column>
                      <el-table-column prop="playStartDate" label="起止时间" show-overflow-tooltip>
                        <template slot-scope="scope">
                          <div>{{scope.row.playStartDate+'/'+scope.row.playEndDate}}</div>
                        </template>
                      </el-table-column>
                      <el-table-column prop="publishStatus" label="状态" show-overflow-tooltip>
                        <template slot-scope="scope">
                          <div v-show="scope.row.publishStatus==0">未到档期</div>
                          <div v-show="scope.row.publishStatus==1">档期中</div>
                          <div v-show="scope.row.publishStatus==2">已过期</div>
                        </template>
                      </el-table-column>
                    </div>
                </zycm-table>
                </div>
              </div>
            </el-col>
          </el-row>
          <span
            style="width: 100%;text-align: center;margin: 40px auto 0;height: 50px;display: block;"
            class="button_dialog"
          >
            <el-button @click="confirmToLead">确定</el-button>
            <el-button v-if="Invoking.forFunctionCode('programList:deleteProgList')" style="background-color:#4d9ce0;color:#fff" @click="confirmSelectIssue('del_prog_list')">删除节目单</el-button>
            <el-button @click="TheImportProgram=false">取 消</el-button>
          </span>
        </div>
      </div>
    </el-dialog>
    <!-- 点击切换链接地址 -->
    <el-dialog
      title="切换连接地址"
      :visible.sync="chainedAddressDialog"
     :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
          <div>
            <zycm-table
                @zyLoadData="loadData"
                zy-table-ref="change_address_table"
                :zy-table-data="tabledataList"
                zy-table-height="400px"
                zy-table-select-type="radio"
                zy-border
                @zyCellClick="zyCellClick"
                :zy-pager-count="5"
            >
              <el-table-column prop="mqProtocol" label="协议" width="60" show-overflow-tooltip></el-table-column>
              <el-table-column prop="mqIp" label="连接地址" min-width="100" show-overflow-tooltip></el-table-column>
              <el-table-column prop="mqPort" label="端口号" width="60" show-overflow-tooltip></el-table-column>
              <el-table-column prop="senderTopName" label="发送队列" show-overflow-tooltip></el-table-column>
              <el-table-column prop="receiverTopName" label="接收队列" show-overflow-tooltip></el-table-column>
              <el-table-column prop="info" label="备注" show-overflow-tooltip></el-table-column>
              <el-table-column prop="creator" label="创建者" show-overflow-tooltip></el-table-column>
            </zycm-table>
          </div>
          <span
            style="width: 100%;text-align: center;margin: 0 auto;height: 50px;display: block;"
            class="button_dialog"
          >
            <el-button style="background-color:#4d9ce0;color:#fff" @click="SureToModifyFtp">提 交</el-button>
            <el-button @click="chainedAddressDialog=false">取 消</el-button>
          </span>
        </div>
      </div>
    </el-dialog>
    <!-- 我的节目包导出列表 -->
    <el-dialog
      title="导出列表"
      :visible.sync="TheExportList"
      :width="this.$store.getters.offsetWidth"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
           <zycm-table
              @zyLoadData="loadData"
              zy-table-ref="export_list_table"
              :zy-table-data="tabledataList"
              zy-table-height="400"
            >
            <el-table-column prop="clientNumber" label="编号" min-width="100" show-overflow-tooltip></el-table-column>
            <el-table-column prop="clientName" label="名称" min-width="100" show-overflow-tooltip></el-table-column>
            <el-table-column prop="mediaGroupName" label="组名" min-width="100" show-overflow-tooltip></el-table-column>
            <el-table-column prop="adStatus" label="状态" min-width="80" show-overflow-tooltip>
              <template slot-scope="props">
                <div v-if="props.row.adStatus==0">
                  <el-tag type="danger" :size="GlobalVar.sizeSet.tag">离线</el-tag>
                </div>
                <div v-else-if="props.row.adStatus==1">
                  <el-tag type="success" :size="GlobalVar.sizeSet.tag">在线</el-tag>
                </div>
                <div v-else-if="props.row.adStatus==-1">
                  <el-tag :size="GlobalVar.sizeSet.tag">拆机</el-tag>
                </div>
                <div v-else-if="props.row.adStatus==-2">
                  <el-tag type="warning" :size="GlobalVar.sizeSet.tag">在线异常</el-tag>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="isDefault" label="操作" width="100">
              <template slot-scope="props">
                <el-button
                  :size="GlobalVar.sizeSet.btn"
                  type="primary"
                  @click="TheExportListRemoveClick(props.row.mid)"
                >删 除</el-button>
              </template>
            </el-table-column>
           </zycm-table>
          <span
            style="width: 100%;text-align: center;margin: 0 auto;height: 50px;display: block;"
            class="button_dialog"
          >
            <a
              :href="this.$http.defaults.baseURL+'export/exportZIPByMids?zycmToken='+this.token+'&uuid='+this.uuid"
              download
              target="_blank"
            >
              <el-button style="background-color:#4d9ce0;color:#fff" @click="exportDataClick">导 出</el-button>
            </a>
            <el-button @click="TheExportList=false">取 消</el-button>
          </span>
        </div>
      </div>
    </el-dialog>
    <!-- 导出信息 -->
    <el-dialog
      title="导出中请勿刷新"
      :visible.sync="dialogIsFinish"
      :width="this.$store.getters.offsetWidth"
      @close="isFinish=[]"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
      :show-close="dialogIsFinishCloseShow"
    >
      <div class="dialog-body">
        <div class="line">
          <div style="height:400px;width: 100%; overflow-y: scroll;">
            <div v-for="(item,index) in isFinish.info" :key="index">{{item}}</div>
          </div>
        </div>
      </div>
    </el-dialog>
    <!-- 预览节目 -->
    <preview v-bind:previewList="previewList" @emptyData="emptyData"></preview>
    <!-- 高级搜索 -->
    <!-- <zycm-dialog zy-ref="advanceSearch_dialog"
      zy-clean-form-ref="form"
      zy-width="576px"
      zy-title="高级搜索"
      :zy-visible="advanceDsearch"
      @zyDialogClose="advanceDsearch=false"
    > -->
    <el-dialog
      title="高级搜索"
      :visible.sync="advanceDsearch"
      :width="this.$store.getters.offsetWidth"
      @close="closeEliminate"
      v-dialogDrag
      ref="dialog__wrapper"
      :close-on-click-modal="false"
    >
      <div class="dialog-body">
        <div class="line">
          <el-form ref="form" :model="advanced">
            <el-form-item style="margin-bottom: 20px;" class="inputCodeName">
              <el-input v-model="advanced.clientNumber" placeholder="请输入编号"></el-input>
              <el-select placeholder="请选择录屏端" v-model="advanced.recordScreenInfo">
                <el-option label="请选择" value></el-option>
                <el-option label="已安装录屏" value="."></el-option>
                <el-option label="未安装录屏" value="-1"></el-option>
              </el-select>
            </el-form-item>
            <div class="item_select">
              <el-select placeholder="请选择状态" v-model="advanced.adStatus">
                <el-option label="请选择" value></el-option>
                <el-option
                  v-for="item in GlobalVar.adStatus"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
              <el-select placeholder="请选择网络" v-model="advanced.netType">
                <el-option label="请选择" value></el-option>
                <el-option
                  v-for="item in GlobalVar.netType"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
              <el-select placeholder="请选择FTP" v-model="advanced.ftpId">
                <el-option label="请选择" value></el-option>
                <el-option
                  :label="item.ipAddr"
                  :value="item.ftpId"
                  v-for="(item,index) in ftpDataList"
                  :key="index"
                ></el-option>
              </el-select>
            </div>
            <el-form-item style="margin-bottom: 20px;">
              <el-input style="width:70%" v-model="advanced.iccid" placeholder="请输入I C C I D"></el-input>
              <!-- <span>
                <el-switch
                  @change="changeSwitch"
                  v-model="advanced.switch"
                  active-color="#13ce66"
                  inactive-color="#ff4949"
                  style=" margin-left: 20px;"
                  active-text="实时刷新"
                ></el-switch>
              </span> -->
            </el-form-item>
          </el-form>
          <span
            style="width: 100%;text-align: center;margin: 0 auto;height: 50px;display: block;"
            class="button_dialog"
          >
            <el-button style="background-color:#4d9ce0;color:#fff" @click="advanceSearch">查 询</el-button>
            <el-button @click="advanceEmpty">清 空</el-button>
          </span>
        </div>
      </div>
    </el-dialog>
    <!-- </zycm-dialog> -->
<!--    <monitDialog ref="monitRef"></monitDialog>-->
  </div>
</template>

<script>
import preview from "../../components/preview/preview.vue";
/*import monitDialog from "../../components/monit/monitDialog.vue";*/
export default {
  components: {
    preview,
   /* monitDialog,*/
  },
  data() {
    return {
      // 此段需要导出的数据
      token: "",
      mids: [],
      uuid: "",
      isFinish: "",
      mediaGroupId: "",
      // 下刊终端
      UnderTheTerminalIssueList: [],
      screenPullDown: [
        {
          value: "1",
          label: "过期节目",
        },
        {
          value: "2",
          label: "优先节目",
        },
      ],
      // 终端日志详情
      logForm: {
        clientNumber: "",
        clientName: "",
        hardware: "",
        machineCode: "",
        voice: "",
        light: "",
        cpuTemp: "",
        sysVersion: "",
        mediaIp: "",
        netType: "",
        ftpId: "",
        downloadEndTime: "",
        strategyForm: "",
        diskSpace: "",
        diskFreeSpace: "",
        strategyForm: "",
      },
      // 输入框内容
      searchInput: "",
      ProgramSearchdata: "",
      query: {
        page: 1,
        pageSize: this.GlobalVar.query.pageSize,
        total: 0,
      },
      query1: {
        page: 1,
        pageSize: this.GlobalVar.query.pageSize,
        total: 0,
      },
      query2: {
        page: 1,
        pageSize: this.GlobalVar.query.pageSize,
        total: 0,
      },
      query3: {
        page: 1,
        pageSize: this.GlobalVar.query.pageSize,
        total: 0,
      },
      // 高级搜索
      advanced: {
        clientNumber: "",
        adStatus: "",
        netType: "",
        ftpId: "",
        iccid: "",
        switch: false,
        clientName: "",
        recordScreenInfo:"",
      },
      // 获取的子节点
      childrenNode: [],
      // 点击子节点获取的数据
      groupData: [],
      active: 1,
      activeName: "first",
      activeShow: "layout",
      // 搜索字段
      inputText: "",
      TerminalHeight: "",
      // 表格展示
      tableData: [],
      // 节目表格展示
      ProgramList: [],
      ProgramSearch: "",
      programId: "",
      // 树形数据
      data: [],
      data1:[],
      defaultProps: {
        children: "children",
        label: "label",
      },
      //   弹框
      LogDetails: false,
      lookProgram: false,
      ProgramReleased: false,
      detailed: false,
      upgradeDialog: false,
      screenshotShow: false,
      programTheIssueOf: false,
      FtpSwitchover: false,
      saveProgramDialog: false,
      TheImportProgram: false,
      chainedAddressDialog: false,
      TheExportList: false,
      dialogIsFinish: false,
      dialogIsFinishCloseShow:false,
      advanceDsearch: false,
      //   显示隐藏节目发布的步骤
      showReleased1: false,
      showReleased2: false,
      showReleased3: false,
      // 显示那个表格调用
      showTableList: 1,
      hebdomad: [
        "星期一",
        "星期二",
        "星期三",
        "星期四",
        "星期五",
        "星期六",
        "星期日",
      ],
      value: "",
      show2: false,
      palyRank: ["普通", "优先播放(不支持时段)"],
      tiemSetting: ["立即下载", "终端闲时(每个终端详情中设置)"],
      // 保存多选的树形数据
      TreeArray: [],
      TreeArraySize: 0,
      // 终端节目表格
      ProgramTable: [],
      Releaseprogram: {
        weekSet: [],
        palyRankVal: "普通",
        tiemSettingVal: "立即下载",
        timeQuantum: [],
        hhmmss: ["00:00:00", "23:59:59"],
        palyDuration: 0,
        several: 0,
        flagPerpetua: true,
        //   节目发布的tab
        activeNameProgram: "time",
      },
      // 弹框显示的布局数据
      layoutData: [],
      division: 10,
      programWidth: "",
      programHeight: "",
      programIdData: {},
      // 发布终端选择的节目
      ProgramSelectList: [],
      // 播放时间
      palyTiemTable: [
        {
          begin: "00:00:00",
          finish: "23:59:59",
          Number1: "0",
        },
      ],
      // 节目详情之终端列表
      terminalList2: [],
      // 主页面勾选的数据
      selectionList: [],
      // 播放日志和运行日志
      LogDetailsTable: [],
      // 升级勾选数据
      upgradeSelectList: "",
      screenshotList: [],
      loading: true,
      selectIssueList: [],
      // 点击节目留下节目id
      programid: "",
      // ftp所有数据
      ftpDataList: [],
      // 查看XXXX终端组的节目勾选数据
      lookProgramselectList: [],
      saveprogram: {
        label: "",
      },
      listId: "",
      // ftp勾选数组
      FtpSelectArrayList: [],
      // 下刊点击下拉框
      TheIssueOfSelect: "",
      // 下刊的表格数据
      BeOfflineList: [],
      // 下刊节目表格点击获取的节目id
      TheIssueOfprogramId: "",
      // 预览的数据
      previewList: {},
      advanceSearchList: {},
      // 选择状态
      selectionState:this.GlobalVar.adStatus,
      // 选择网络
      selectiveNetwork:this.GlobalVar.netType,
      setInter: "",
      imgurlNum: 0,
      conflictTimeList: [],
      thisFormData: new FormData(),
      tabledataList:[],//保存当页的所有table数据
      tablePageList:[],//保存对应table的page数据
      downProgSelectedRow:{},
      flagHerf:false,
      searchInterval:"",
      showSyncGroupProgBtn:1,//标示显示原节目与同步节目字段 0查原节目 1查同步组节目
      masterGroupId:"",
      masterGroupName:"",
    };
  },

  created() {
    this.clientHeight();
    this.tableList();
    this.QueryAllFtp();
    this.currentTableLoad("terminal_publish_table",true);
  },
  destroyed(){
    if(this.searchInterval){
      clearInterval(this.searchInterval);
    }
  },
  computed: {
    flagPerpetuaChange: {
      set: function (v) {
        this.Releaseprogram.flagPerpetua = v;
        if (v) {
          this.perpetuaBtn(); //选中永久时清空时间
        }
      },
      get: function () {
        return this.Releaseprogram.flagPerpetua;
      },
    },
  },
  methods: {
    //给子组件刷新用
    async loadData(formData,tableRef){
      //提前修正isReqData状态 后续赋值随时会触发table组件的computed  后面还要进行一次修正
      for(let key in this.tabledataList){
        if(this.tabledataList[key].ref === tableRef){
          this.tabledataList[key].isReqData=true;//标记更新数据的状态 组件中会根据此判断是否重新更新数据
        }else{
          this.tabledataList[key].isReqData=false;
        }
      }

      //子组件触发查询时  处理查询的参数
      if(this.tablePageList[tableRef]){
        this.tablePageList[tableRef].set("page", formData.get("page"));
        this.tablePageList[tableRef].set("pageSize", formData.get("pageSize"));
      }

      let res;
      if(tableRef == "terminal_publish_table"){//终端列表


        res = await this.$http.post("mediaAttribute/selectPage", this.tablePageList[tableRef]);
        if (res.data.dataList) {
          res.data.dataList.forEach((ele) => {
            if (!ele.playProgramNum) {
              ele.playProgramNum = 0;
            } else if (!ele.programNum) {
              ele.programNum = 0;
            }
          });
        }
        //每次请求数据后 清空选中数据
        this.selectionList =[];
        this.tableData = res.data;
      }else if(tableRef == "dialog_prog_select_publish_table"){//发布-选择节目列表
        res = await this.$http.post("program/selectPage", this.tablePageList[tableRef]);
        //每次请求数据后 清空选中数据
        this.ProgramSelectList = [];
      }else if(tableRef == "media_group_prog_table"){//查询终端组的节目
        res = await this.$http.post("publishRecord/selectPage", this.tablePageList[tableRef]);
        if(res.data.dataList.length>0){
          this.flagHerf=true
        }else{
          this.flagHerf=false
        }
        //每次请求数据后 清空选中数据
        this.lookProgramselectList=[];
      }else if(tableRef == "prog_list_table"){//查询节目单
        res = await this.$http.post("programList/selectPage", this.tablePageList[tableRef]);
        //清空单选
        this.TheIssueOfprogramId = "";
        this.listId = "";
      }else if(tableRef == "prog_list_detail_table"){//查询节目单详情
        res = await this.$http.post("programList/selectProgListDetail", this.tablePageList[tableRef]);

      }else if(tableRef == "fb_prog_material_table"){//查看节目的素材 其他地方已查询出结果 这里直接组装下数据
        res = {};
        res.data = {
                "result":"success",
                "data":this.programIdData.material
                };
      }else if(tableRef == "prog_to_media_group_table"){//查询节目发布到的终端组
        res = await this.$http.post("publishRecord/selectPageGroupByProg", this.tablePageList[tableRef]);

      }else if(tableRef == "down_prog_table"){//下刊 节目查询
        res = await this.$http.post("program/selectPageProgTimeMode", this.tablePageList[tableRef]);
        //清理单选
        this.TheIssueOfprogramId = "";
      }else if(tableRef == "down_prog_media_table"){
        res = await this.$http.post("publishRecord/selectPageGroupByProg", this.tablePageList[tableRef]);
        //清理多选
        this.selectIssueList = [];
      }else if(tableRef == "media_run_log_table"){//查询终端运行日志
        res = await this.$http.post("runLog/selectPage", this.tablePageList[tableRef]);

      }else if(tableRef == "media_play_log_table"){//查询终端播放日志
        res = await this.$http.post("playLog/selectPage", this.tablePageList[tableRef]);

      }else if(tableRef == "get_client_file_table"){//查询终端文件
        res = await this.$http.post("mediaAttribute/getClientFile", this.tablePageList[tableRef]);
        if(res && res.data.result==="success" && res.data.data.length==0){
          this.messageText("终端数据获取会有延迟请多刷新几次");
        }
      }else if(tableRef == "change_address_table"){
        res = await this.$http.post("mq/selectPage", this.tablePageList[tableRef]);
        this.FtpSelectArrayList = "";
      }else if(tableRef == "change_ftp_table"){
        res = await this.$http.post("ftpInfo/selectInfo", this.tablePageList[tableRef]);
        this.FtpSelectArrayList = "";
      }else if(tableRef == "export_list_table"){
        res = await this.$http.post("userExportList/selectPage", this.tablePageList[tableRef]);

      }else if(tableRef == "select_apk_table"){
        res = await this.$http.post("material/selectApk", this.tablePageList[tableRef]);
        this.upgradeSelectList="";
      }

      if(res && res.data.result==="success"){
        //记录更新分页数据
        res.data.ref = tableRef;
        //更新记录
        let sign = 0;
        for(let key in this.tabledataList){
          if(this.tabledataList[key].ref === tableRef){
            if(sign > 1){//去掉重复数据
              this.tabledataList.splice(key,1);
            }else{
              this.tabledataList.splice(key,1,res.data);
              this.tabledataList[key].isReqData=true;//标记更新数据的状态 组件中会根据此判断是否重新更新数据
            }
            sign++;
          }else{
            this.tabledataList[key].isReqData=false;
          }
        }
        if(sign == 0){//没有初始化时
          res.data.isReqData = true;
          this.tabledataList.push(res.data);
        }
      }else{
        if(res && res.data.result==="error"){
          this.$message({
            type: "error",
            message: res.data.message,
          });
        }else{
          this.$message({
            type: "error",
            message: "请求数据出现异常",
          });
        }
      }

    },
    //当页刷新数据
    currentTableLoad(tableRef,firstPage,fd){
      if(firstPage){//加载第一页数据
        if(!this.tablePageList[tableRef]){
         this.tablePageList[tableRef] = new FormData();
         this.tablePageList[tableRef].set("pageSize", this.GlobalVar.query.pageSize);
        }
        this.tablePageList[tableRef].set("page", 1);
      }
      //如果有其他查询参数 合并处理
      if(fd){
        for(let item of fd.entries()) {
          this.tablePageList[tableRef].set(item[0], item[1]);
        }
      }
      this.loadData(this.tablePageList[tableRef],tableRef);
    },
    //表格checkbox单点 全选
    tableSelect(selection,row,tableRef){
      if(tableRef === "dialog_prog_select_publish_table"){//发布-选择节目
        this.ProgramSelectList = selection;
      }else if(tableRef === "media_group_prog_table"){//查看节目-选择下刊节目
        this.lookProgramselectList = selection;
      }else if(tableRef == "down_prog_media_table"){//下刊 选择下刊终端组
        this.selectIssueList = selection;
      }else if(tableRef == "terminal_publish_table"){//终端列表
        this.selectionList = selection;
      }
    },
    monitClick(e){
        this.$refs.monitRef.openWin(e);
    },
    //行 单元格 点击单选
    async zyCellClick(row, column, cell, event,tableRef){
      let fd = new FormData();
      let token = window.sessionStorage.getItem("token");
      fd.append("zycmToken", token);
      if(tableRef === "prog_list_table"){//节目单的单选点击
        this.TheIssueOfprogramId = row.programId;
        //查询节目单的详细
        this.listId = row.listId;
        fd.append("listId", row.listId);
        this.currentTableLoad("prog_list_detail_table",true,fd);
      }else if(tableRef === "down_prog_table"){//下刊 节目的单选点击
        this.TheIssueOfprogramId = row.programId;
        this.downProgSelectedRow = row;
        fd.append("programId",this.TheIssueOfprogramId);
        this.currentTableLoad("down_prog_media_table",true,fd);
      }else if(tableRef === "change_address_table"){
        this.FtpSelectArrayList = row;
      }else if(tableRef === "change_ftp_table"){
        this.FtpSelectArrayList = row;
      }else if(tableRef === "select_apk_table"){
        this.upgradeSelectList = row;
      }

    },
    zyCleanSelectedToAutoPage(tableRef){
      if(tableRef === "change_ftp_table"){
        this.FtpSelectArrayList ="";
      }
    },
    showUnionTime(d) {
      if (d.countTime == 1 || d.countTime == 0) {
        if (
          d.playStartDate == null &&
          d.playStartTime == null &&
          d.playEndDate == null &&
          d.playEndTime == null
        ) {
          return "";
        }
        if (d.unionTime && d.unionTime.split("#")[2]) {
          return (
            d.playStartDate +
            " " +
            d.playStartTime +
            " 至 " +
            d.playEndDate +
            " " +
            d.playEndTime +
            "(" +
            d.unionTime.split("#")[2] +
            ")"
          );
        } else {
          return (
            d.playStartDate +
            " " +
            d.playStartTime +
            " 至 " +
            d.playEndDate +
            " " +
            d.playEndTime
          );
        }
      } else {
        if (
          d.playStartDate == null &&
          d.playStartTime == null &&
          d.playEndDate == null &&
          d.playEndTime == null
        ) {
          return "";
        } else {
          var s =
            "(有" +
            d.countTime +
            "个时段)" +
            d.playStartDate +
            " " +
            d.playStartTime +
            " 至 " +
            d.playEndDate +
            " " +
            d.playEndTime +
            "<br>时段详细:";
          var arr = d.unionTime.split(",");
          for (var n = 0; n < arr.length; n++) {
            var item = arr[n].split("#");
            s += item[0] + " - " + item[1] + "(" + item[2] + ");<br>";
          }
          return s;
        }
      }
    },
    rowExpansion(row, column, cell, event) {
      //过滤掉与行点击事件冲突的列
      if (cell.className.search("stopRowClick") >= 0) return;
      this.$refs.refTable.toggleRowExpansion(row);
    },
    // 判断发布节目时是否选择了永久或者日期
    changeTimeQuantum() {
      if (this.Releaseprogram.flagPerpetua) {
        this.Releaseprogram.flagPerpetua = false;
      }
    },
    // 高级搜索
    advanceSearch() {
      this.ftpDataList.forEach((element) => {
        if (element.ipAddr == this.advanced.ftpId) {
          this.advanced.ftpId = element.ftpId;
        }
      });
      let fd = new FormData();
      fd.set("clientNumber", this.advanced.clientNumber);
      fd.set("adStatus", this.advanced.adStatus);
      fd.set("netType", this.advanced.netType);
      fd.set("ftpId", this.advanced.ftpId);
      fd.set("iccid", this.advanced.iccid);
      fd.set("clientName", this.searchInput);
      fd.set("recordScreenInfo", this.advanced.recordScreenInfo);
      this.currentTableLoad("terminal_publish_table",true,fd);
      var ftpId = "";
      this.ftpDataList.forEach((element) => {
        if (element.ftpId == this.advanced.ftpId) {
          ftpId = element.ipAddr;
        }
      });
      let recordScreenInfo_str ="";
      if(this.advanced.recordScreenInfo){
        recordScreenInfo_str = this.advanced.recordScreenInfo==='-1'?'未安装录屏':'已安装录屏';
      }
      this.advanceSearchList = {
        clientName: this.advanced.clientName,
        clientNumber: this.advanced.clientNumber,
        adStatus: this.zycmUtils.getLableByVal(this.advanced.adStatus,this.GlobalVar.adStatus),
        netType: this.zycmUtils.getLableByVal(this.advanced.netType,this.GlobalVar.netType),
        ftpId: ftpId,
        iccid: this.advanced.iccid,
        recordScreenInfo:recordScreenInfo_str,
      };
      this.advanceDsearch = false;
    },
    advanceDsearchTrue(){
        this.advanced = {
        clientName: this.advanceSearchList.clientName,
        clientNumber: this.advanceSearchList.clientNumber,
        adStatus: this.zycmUtils.getValByLabel(this.advanceSearchList.adStatus,this.GlobalVar.adStatus),
        netType:this.zycmUtils.getValByLabel(this.advanceSearchList.netType,this.GlobalVar.netType),
        ftpId:this.advanceSearchList.ftpId?String(this.advanceSearchList.ftpId):'',
        iccid: this.advanceSearchList.iccid,
        recordScreenInfo:this.advanceSearchList.recordScreenInfo?(this.advanceSearchList.recordScreenInfo==='未安装录屏'?'-1':'.'):''
      };
      this.advanceDsearch=true
    },
    // 点击关闭高级搜索的tag
    closableTag(e) {
      for (const key in this.advanceSearchList) {
        if (e == key) {
          this.advanceSearchList[key] = "";
          this.advanced[key] = "";
          this.tablePageList["terminal_publish_table"].set(key,"");
          for (var key1 of this.tablePageList["terminal_publish_table"].keys()) {
          }
        }
      }
      this.currentTableLoad("terminal_publish_table",true);
    },
    advanceEmpty() {
      this.advanced.clientNumber = "";
      this.advanced.adStatus = "";
      this.advanced.netType = "";
      this.advanced.ftpId = "";
      this.advanced.iccid = "";
      this.advanced.recordScreenInfo="";
      //清空tag标签
      this.advanceSearchList = {};
      this.searchInput = "";
      this.tablePageList["terminal_publish_table"].set("clientName","");

      for(let key in this.advanced){
        this.tablePageList["terminal_publish_table"].set(key,"");
      }
      this.currentTableLoad("terminal_publish_table",true);
      // this.advanceDsearch = false;
    },
    // 开关
    changeSwitch() {
      this.searchInterval = setInterval(() => {
        if (!this.advanced.switch) {
          clearInterval(this.searchInterval);
        } else {
          this.searchInputText(1);
          //this.tableList();
        }
      }, 5000);
    },
    // 点击节目发布弹框tab
    tabClickProgram() {
      this.$refs.program_num.forEach((ele, index) => {
        this.$refs.program_num[index].style.backgroundColor = "#fff";
        this.$refs.program_num[index].style.color = "#4d9ce0";
      });
      this.Releaseprogram.hhmmss = ["00:00:00", "23:59:59"];
      this.Releaseprogram.weekSet = [];
      this.Releaseprogram.timeQuantum = [];
      this.Releaseprogram.palyRankVal = "普通";
      this.Releaseprogram.tiemSettingVal = "立即下载";
      this.Releaseprogram.palyDuration = 0;
      this.Releaseprogram.several = 0;
      this.Releaseprogram.flagPerpetua = true;
      this.palyTiemTable = [
        {
          begin: "00:00:00",
          finish: "23:59:59",
          Number1: "0",
        },
      ];
    },
    closeEliminate() {
      this.activeName = "first";//终端详情
      this.TheIssueOfprogramId = "";//下刊选中的节目
      this.showReleased1 = false;
      this.showReleased2 = false;
      this.showReleased3 = false;
      this.ProgramSelectList = [];
      this.Releaseprogram.hhmmss = ["00:00:00", "23:59:59"];
      this.UnderTheTerminalIssueList = [];

      this.Releaseprogram.weekSet = [];
      this.Releaseprogram.timeQuantum = [];
      this.Releaseprogram.palyRankVal = "普通";
      this.Releaseprogram.tiemSettingVal = "立即下载";
      this.Releaseprogram.palyDuration = "0";
      this.Releaseprogram.several = "0";
      this.active = 1;
      this.Releaseprogram.flagPerpetua = true;
      this.palyTiemTable = [
        {
          begin: "00:00:00",
          finish: "23:59:59",
          Number1: "0",
        },
      ];

      this.showSyncGroupProgBtn=1;
      this.masterGroupId="";
      this.masterGroupName="";
      // this.advanced.clientNumber = "";
      // this.advanced.adStatus = "";
      // this.advanced.netType = "";
      // this.advanced.ftpId = "";
      // this.advanced.iccid = "";
    },
    // 点击预览按钮
    previewProgram(e) {
      this.previewList = e;
    },
    emptyData(val) {
      this.previewList = "";
    },
    // 点击上移下移
    async moveUpClick(e, d) {
      let i = e.$index;
      if (d == "up") {
        i = i - 1;
        // text = "上移";
      } else if (d == "down") {
        i = i + 1;
        // text = "下移";
      }
      let publishIdAndOrder = e.row.publishId + "#" + e.row.programOrder;
      let publishIdAndOrder2 = "";
      this.ProgramTable.forEach((ele, index) => {
        if (i == index) {
          publishIdAndOrder2 = ele.publishId + "#" + ele.programOrder;
        }
      });
      if (publishIdAndOrder == publishIdAndOrder2) {
        publishIdAndOrder2 = "";
      }
      let token = window.sessionStorage.getItem("token");
      let formData = new FormData();
      formData.append("zycmToken", token);
      formData.append("publishIdAndOrder", publishIdAndOrder);
      formData.append("publishIdAndOrder2", publishIdAndOrder2);
      formData.append("mediaGroupId", this.childrenNode);
      if (d == "up") {
        formData.append("direction", 1);
      } else if (d == "down") {
        formData.append("direction", 2);
      }
      const { data: res } = await this.$http.post(
        "publishRecord/updateProgramOrderByKey",
        formData
      );

      if (res.result == "error") {
        this.messageText(res.message, "error");
      }
      this.currentTableLoad("media_group_prog_table",false);
    },
    // 点击同步
    async synchronization() {
      let token = window.sessionStorage.getItem("token");
      let formData = new FormData();
      formData.append("zycmToken", token);
      formData.append("mediaGroupIds", this.groupData.value);
      const { data: res } = await this.$http.post(
        "publishRecord/publishProgByGroup",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }
    },
    // 点击导出列表导出按钮
    async exportDataClick() {
     /*  var timestamp = Date.parse(new Date());
      let uid = window.sessionStorage.getItem("uid");
      this.uuid = timestamp + "_" + uid;
      let token = window.sessionStorage.getItem("token");
      this.token = token; */

     /*  let mids = [];
      this.ProgramList.forEach((ele) => {
        mids.push(ele.mid);
      });
      this.mids = mids; */

      //let formData = new FormData();
      for(let item in this.tabledataList){
        if(this.tabledataList[item].ref === "export_list_table" && this.tabledataList[item].dataList.length == 0){
          this.messageText("当前用户导出列表中无终端数据", "warning");
          return;
        }
      }

      let formData2 = new FormData();
      formData2.append("zycmToken", this.token);
      formData2.append("uuid", this.uuid);
      formData2.append("openLoading", 0); //不开启加载效果
      this.dialogIsFinish = true;
      this.dialogIsFinishCloseShow=false;
      let setTiem = setInterval(async () => {
        const { data: res2 } = await this.$http.post(
          "export/getExportInfo",
          formData2
        );
        if(res2.result == "success"){
           if (res2.data.isFinish) {
             this.dialogIsFinishCloseShow=true;
            clearInterval(setTiem);
          }else{
            this.dialogIsFinishCloseShow=false;
          }
          this.isFinish = res2.data;
          //this.dialogIsFinish = true;
        }else{
          this.dialogIsFinishCloseShow=true;
          clearInterval(setTiem);
          this.isFinish= {"info":[res2.message],"isFinish":true};
          this.messageText(res2.message, "error");
        }
      }, 2000);
     /*  if (this.isFinish.isFinish) {
        clearInterval(setTiem);
      }
      formData.append("zycmToken", token);
      formData.append("mids", mids);
      formData.append("uuid", timestamp + "_" + uid);
      const { data: res1 } = await this.$http.post(
        "export/exportZIPByMids",
        formData
      ); */
    },
    DeriveTerminalGroups() {
       for(let item in this.tabledataList){
        if(this.tabledataList[item].ref === "media_group_prog_table" && this.tabledataList[item].dataList.length == 0){
          this.messageText("当前终端组无节目", "warning");
          return;
        }
      }
      let token = window.sessionStorage.getItem("token");
      let uid = window.sessionStorage.getItem("uid");
      let randomUuid = new Date().getTime() + "_" + uid;
      this.token = token;
      this.uuid = randomUuid;
      //获取下载处理过程信息
      let formData2 = new FormData();
      formData2.append("zycmToken", token);
      formData2.append("uuid", randomUuid);
      formData2.append("openLoading", 0); //不开启加载效果
      this.dialogIsFinish = true;
      this.dialogIsFinishCloseShow=false;
      let setTiem = setInterval(async () => {
        const { data: res2 } = await this.$http.post(
          "export/getExportInfo",
          formData2
        );
        if (res2.result == "success") {
          if (res2.data.isFinish) {
            this.dialogIsFinishCloseShow=true;
            clearInterval(setTiem);
          }else{
            this.dialogIsFinishCloseShow=false;
          }
          this.isFinish = res2.data;
          //this.dialogIsFinish = true;
        } else {
          this.dialogIsFinishCloseShow=true;
          clearInterval(setTiem);
          this.isFinish= {"info":[res2.message],"isFinish":true};
          this.messageText(res2.message, "error");
        }
      }, 2000);

      //发起下载请求
     /*  let formData1 = new FormData();
      formData1.append("zycmToken", token);
      formData1.append("mediaGroupId", this.groupData.data);
      formData1.append("uuid", randomUuid);
      formData1.append("openLoading", 0); //不开启加载效果
      const { data: res1 } = this.$http.post(
        "export/exportZIPByMediaGroupId",
        formData1
      );
    */
    },
    // 导出列表
    deriveTable() {
      this.currentTableLoad("export_list_table",true);
      //打开列表前初始化参数 便于导出节目包
      var timestamp = Date.parse(new Date());
      let uid = window.sessionStorage.getItem("uid");
      this.uuid = timestamp + "_" + uid;
      let token = window.sessionStorage.getItem("token");
      this.token = token;
      this.TheExportList = true;
    },
    // 节目包导出列表删除\
    TheExportListRemoveClick(e) {
      this.$confirm("您确定删除吗？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.TheExportListRemove(e);
        })
        .catch(() => {
          this.messageText("已取消删除");
        });
    },
    async TheExportListRemove(e) {
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("mid", e);
      const { data: res } = await this.$http.post(
        "userExportList/deleteByPrimaryKey",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }
      this.currentTableLoad("export_list_table",false);
    },
    // 点击拆屏
    SplitScreenClick(e,row) {
      let text = "";
      let textConfirm = "";
      if (e == "cai") {
        text = "请选择需要拆屏的终端";
        textConfirm = "您确定拆屏吗？";
      } else if (e == "ji") {
        text = "请选择需要激活的终端";
        textConfirm = "您确定激活吗？";
      } else if (e == "ce") {
        text = "请选择需要测速其中一条终端";
        textConfirm =
          "您确定测速吗？确定测速后需要5分钟才会更新网速数据请稍后查看数据！";
      } else if (e == "dao") {
        text = "请选择需要导出的终端";
        textConfirm = "您确定加入批量导出吗？";
      }
      if (e != "ce" && this.selectionList.length == 0) {
        this.messageText(text);
        return;
      }
      //测速需要已激活在线机器
      if (e == "ce" && (row.workStatus == 0 ||row.adStatus != 1)) {
        this.messageText("请选择在线已激活的设备");
        return;
      }
      if (e == "cai") {
        for(let item in this.selectionList){
          if(this.selectionList[item].adStatus == -1){
            this.messageText("请不要重复拆机操作");
            return;
          }
        }

      }
      if (e == "ji") {
        for(let item in this.selectionList){
          if(this.selectionList[item].adStatus == -1){
            this.messageText("已拆机无需激活");
            return;
          }
          if (this.selectionList[item].workStatus == 1) {
            this.messageText("请选择未激活设备");
            return;
          }
        }

      }
      this.$confirm(textConfirm, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.dismantleActivateVelocity(e,row);
        })
        .catch(() => {});
    },
    async dismantleActivateVelocity(e,row) {
      let formData = new FormData();
      let url = "";
      let machineCodes = [];
      let mids = [];
      this.selectionList.forEach((ele) => {
        machineCodes.push(ele.machineCode);
        mids.push(ele.mid);
      });
      if (e == "cai") {
        formData.append("machineCodes", machineCodes);
        url = "mediaAttribute/discardMedia";
      } else if (e == "ji") {
        formData.append("machineCodes", machineCodes);
        url = "mediaAttribute/activeMedia";
      } else if (e == "ce") {
        formData.append("machineCode", row.machineCode);
        url = "mediaAttribute/testNetSpeed";
      } else if (e == "dao") {
        formData.append("mids", mids);
        url = "userExportList/addExportList";
      }
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      const { data: res } = await this.$http.post(url, formData);
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }
      if(e == "cai" || e == "ji"){
        this.currentTableLoad("terminal_publish_table",false);
      }
    },
    // el-dropdown 下拉菜单指令
    commandTarget(command) {
      if (command == "a") {
        this.switchScreen("open");
      } else if (command == "b") {
        this.switchScreen("prep");
      }
    },
    // 点击开关屏
    switchScreen(e) {
      let text = "";
      let textConfirm = "";
      if (e == "open") {
        text = "请选择需要开屏的终端";
        textConfirm = "您确定开屏吗？";
      } else if (e == "prep") {
        text = "请选择需要关屏的终端";
        textConfirm = "您确定关屏吗？";
      }
      if (this.selectionList.length == 0) {
        this.$message({
          type: "warning",
          message: text,
        });
        return;
      }
       if (!this.judgeWhetherToActivate(this.selectionList)) {
        return;
      }

      if (e == "open") {
        for(let item in this.selectionList){
          if(this.selectionList[item].videoOutMode == 1){
             this.messageText("请选择已经关屏的终端机来做开屏操作！");
              return;
          }
        }

      } else if (e == "prep") {
         for(let item in this.selectionList){
          if(this.selectionList[item].videoOutMode == 0){
             this.messageText("请选择已经开屏的终端机来做开屏操作！");
              return;
          }
        }
      }
      this.$confirm(textConfirm, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.switchScreenRequest(e);
        })
        .catch(() => {});
    },
    // 开关屏的数据请求
    async switchScreenRequest(e) {
      let screenStatus = "";
      if (e == "open") {
        screenStatus = 1;
      } else if (e == "prep") {
        screenStatus = 0;
      }
      let machineCodes = [];
      this.selectionList.forEach((ele) => {
        machineCodes.push(ele.machineCode);
      });
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("machineCodes", machineCodes);
      formData.append("screenStatus", screenStatus);
      formData.append("zycmToken", token);
      const { data: res } = await this.$http.post(
        "mediaAttribute/openOrCloseScreen",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }
      this.currentTableLoad("terminal_publish_table",false);
    },

    // 点击切换链接地址
    chainedAddress() {
      if (this.selectionList.length == 0) {
        this.messageText("请选择需要切换链接地址的终端");
        return;
      }
      if (!this.judgeWhetherToActivate(this.selectionList)) {
        return;
      }
      this.TheImportProgramClick("change_address_table");
      this.chainedAddressDialog = true;
    },
    // 勾选变单选
    handleSelectionChange1(val) {
      this.$nextTick(() => {
        if (val.length > 1) {
          this.$refs.Ftpselect.clearSelection();
          this.$refs.Ftpselect.toggleRowSelection(val[val.length - 1]);
        }
        this.FtpSelectArrayList = [];
        this.FtpSelectArrayList.push(val[val.length - 1]);
      });
    },
    handleSelectionChange2(val) {
      this.$nextTick(() => {
        if (val.length > 1) {
          this.$refs.refTable1.clearSelection();
          this.$refs.refTable1.toggleRowSelection(val[val.length - 1]);
        }
        this.selectionList = [];
        if (!val[val.length - 1]) {
          return;
        } else {
          this.selectionList.push(val[val.length - 1]);
        }
      });
    },
    // 点击提交切换Ftp 点击提交切换链接地址
    async SureToModifyFtp() {
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      let text = "";
      let url = "";
      let ftpIds = [];
      let mid = [];
      let machineCodes = [];
      let mqIds = [];
      this.selectionList.forEach((ele) => {
        mid.push(ele.mid);
        machineCodes.push(ele.machineCode);
      });
      if (this.FtpSwitchover) {
        if(!this.FtpSelectArrayList || !this.FtpSelectArrayList.ftpId){
          this.messageText("请选择将要切换的ftp地址", "warning");
          return;
        }

        url = "mediaAttribute/changeFtp";
        formData.append("ftpId", this.FtpSelectArrayList.ftpId);
        formData.append("mids", mid);
      } else if (this.chainedAddressDialog) {
        if(!this.FtpSelectArrayList || !this.FtpSelectArrayList.mqId){
          this.messageText("请选择将要切换的连接地址", "warning");
          return;
        }

        url = "mediaAttribute/mqSwitch";
        formData.append("machineCodes", machineCodes);
        formData.append("mqId", this.FtpSelectArrayList.mqId);
      }

      const { data: res } = await this.$http.post(url, formData);
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }
      this.FtpSwitchover = false;
      this.chainedAddressDialog = false;
      this.FtpSelectArrayList = "";
    },
    // 点击导入节目单 点击切换链接地址
    async TheImportProgramClick(ref) {
      if(ref === "prog_list_table"){//打开导入节目单
        //清理数据
        for(let key in this.tabledataList){
          if(this.tabledataList[key].ref === "prog_list_detail_table"){
            this.tabledataList[key].data = [];
          }
        }
        this.listId = "";
        this.currentTableLoad(ref,true);

        this.TheImportProgram = true;
      }else if(ref === "change_address_table"){//切换连接地址
        //加载连接地址
        this.currentTableLoad("change_address_table",true);
      }
      return;

    },
    // 点击导入节目单确定按钮
    async confirmToLead() {
      if(!this.listId){
       this.$message({
          type: "warning",
          message: "请选择导入节目单数据",
        });
        return;
      }
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("listId", this.listId);
      formData.append("mediaGroupId", this.childrenNode);
      const { data: res } = await this.$http.post(
        "programList/importProglist",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
        this.currentTableLoad("media_group_prog_table",true);
        this.TheImportProgram = false;
      } else {
        this.messageText(res.message, "error");
      }
    },
    async submitSaveLabel() {
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("listName", this.saveprogram.label);
      formData.append("mediaGroupId", this.childrenNode);
      const { data: res } = await this.$http.post(
        "programList/addProgList",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
        this.saveprogram.label = "";
        this.saveProgramDialog = false;
      } else {
        this.messageText(res.message, "error");
      }
    },
    // 点击终端组的节目下刊
    async LogDetailsIssue() {
      if (this.lookProgramselectList.length == 0) {
        this.messageText("请选择需要下刊的节目");
        return;
      }
      let pubIds = [];
      this.lookProgramselectList.forEach((ele) => {
        pubIds.push(ele.publishId);
      });
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("pubIds", pubIds);
      formData.append("mediaGroupId", this.childrenNode);
      const { data: res } = await this.$http.post(
        "publishRecord/progDownForGroup",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }
      this.currentTableLoad("media_group_prog_table",true);
    },
    // 查看终端组的节目勾选数据
    lookProgramselect(selection) {
      this.lookProgramselectList = selection;
    },
    // ftp切换弹框
    showFtpSwitchover() {
      if (this.selectionList.length == 0) {
        this.$message({
          type: "warning",
          message: "请选择需要ftp切换的终端",
        });
        return;
      }
      if (!this.judgeWhetherToActivate(this.selectionList)) {
        return;
      }
      this.currentTableLoad("change_ftp_table",true);
      this.FtpSwitchover = true;
    },
    // 获取ftp信息
    async QueryAllFtp() {
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      const { data: res } = await this.$http.post(
        "ftpInfo/selectInfo",
        formData
      );
      this.ftpDataList = res.data;
      this.query1.page = res.page == "undefined" ? 1 : res.page;
      this.query1.pageSize = res.pageSize == "undefined" ? this.GlobalVar.query.pageSize : res.pageSize;
      this.query1.total = res.total;
    },
    // 点击清理过期文件按钮
    clearScratchFile() {
      let array = [];
      let text = "";
      if (this.lookProgram) {
        array = this.lookProgramselectList;
        text = "下刊的节目";
      } else {
        array = this.selectionList;
        text = "清理过期终端文件的终端";
      }
      if (array.length == 0) {
        this.$message({
          type: "warning",
          message: "请选择需要" + text,
        });
        return;
      }
      if (
        !this.lookProgram &&
        !this.judgeWhetherToActivate(this.selectionList)
      ) {
        return;
      }
      this.$confirm("您确定" + text + "吗？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          if (this.lookProgram) {
            this.LogDetailsIssue();
          } else {
            this.clearScratchFileAxios();
          }
        })
        .catch(() => {});
    },
    // 清理过期文件请求
    async clearScratchFileAxios() {
      let machineCodes = [];
      this.selectionList.forEach((ele) => {
        machineCodes.push(ele.machineCode);
      });
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("machineCodes", machineCodes);
      const { data: res } = await this.$http.post(
        "mediaAttribute/deleteClientFile",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }
    },
    // 点击查询弹框里的节目
    QueryProgram(empty) {
      if (empty == "empty") {
        this.ProgramSearch = "";
      }
      this.getProgramList();
      this.query1.page = 1;
    },
    // 点击确定下刊按钮
    async confirmSelectIssue(type) {
      if (!this.TheImportProgram && this.selectIssueList.length == 0) {
        this.$message({
          type: "warning",
          message: "请选择需要下刊的节目",
        });
        return;
      }else if(this.TheImportProgram && !this.listId){
           this.$message({
          type: "warning",
          message: "请选择需要删除的节目单",
        });
        return;
      }
      let formData = new FormData();
      let url = "";
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      if(type == "del_prog_list"){
        formData.append("listId", this.listId);
        url = "programList/deleteProgList";
      }else if(type == "down_prog"){
        let mediaGroupId = [];
        this.selectIssueList.forEach((ele) => {
          mediaGroupId.push(ele.mediaGroupId);
        });
        formData.append("mediaGroupIds", mediaGroupId);
        formData.append("programId", this.TheIssueOfprogramId);
        url = "publishRecord/progDownForProg";
      }

      const { data: res } = await this.$http.post(url, formData);
      if (res.result == "success") {
        this.messageText(res.message, "success");
        if(type == "del_prog_list"){
          //刷新节目单列表
          this.currentTableLoad("prog_list_table",true);
          //清空节目单的详情列表
          for(let key in this.tabledataList){
            if(this.tabledataList[key].ref === "prog_list_detail_table"){
              this.tabledataList[key].data = [];
            }
          }
          this.listId = "";
        }else if(type == "down_prog"){
          //刷新下刊后的终端组列表
          this.currentTableLoad("down_prog_media_table",true);
        }
      } else {
        this.messageText(res.message, "error");
      }
    },
    // 勾选需要下刊的终端节目
    selectIssue(selection) {
      this.selectIssueList = selection;
    },
    // 点击选择的下刊节目
    async programTheIssueOfSelect(row) {
      if (row) {
        this.TheIssueOfprogramId = row.programId;
      }
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      let url = "";
      if (this.TheImportProgram) {
        if (row) {
          this.listId = row.listId;
          formData.append("listId", row.listId);
          url = "programList/selectProgListDetail";
        } else {
          formData.append("page", this.query2.page);
          formData.append("pageSize", this.GlobalVar.query.pageSize);
          url = "programList/selectPage";
        }
      } else {
        formData.append("page", this.query2.page);
        formData.append("pageSize", this.query2.pageSize);
        formData.append("programId", this.TheIssueOfprogramId);
        url = "publishRecord/selectPageGroupByProg";
      }
      const { data: res } = await this.$http.post(url, formData);
      if (this.TheImportProgram) {
        if (row) {
          this.UnderTheTerminalIssueList = res.data;
          this.query3.page = res.page;
          this.query3.pageSize = res.pageSize;
          this.query3.total = res.total ? res.total : 0;
        } else {
          this.ProgramList = res.dataList;
          this.query2.page = res.page;
          this.query2.pageSize = res.pageSize;
          this.query2.total = res.total ? res.total : 0;
        }
      } else {
        this.UnderTheTerminalIssueList = res.dataList;
        this.query2.page = res.page;
        this.query2.pageSize = res.pageSize;
        this.query2.total = res.total ? res.total : 0;
      }
      this.UnderTheTerminalIssueList.forEach((ee) => {
        for (const key in ee) {
          if (ee[key] == null) {
            ee[key] = 0;
          }
        }
      });

      if (row) {
        this.programid = row;
      }

    },
    // 点击下刊
    async TheIssueOfClick(e) {
      //清理数据
      for(let key in this.tabledataList){
        if(this.tabledataList[key].ref === "down_prog_media_table"){
          this.tabledataList[key].dataList = [];
        }
      }
      this.TheIssueOfprogramId = "";
      this.downProgSelectedRow = {};

      if(this.tablePageList["down_prog_media_table"])
      this.tablePageList["down_prog_media_table"].set("programId","");

      if (e != "page") {
        this.ProgramSearch = "";
        this.TheIssueOfSelect = "";
      }
      let formData = new FormData();
      formData.append("programName", this.ProgramSearch);
      formData.append("searchProgType", this.TheIssueOfSelect);
      formData.append("auditStatus", 1);
      this.currentTableLoad("down_prog_table",true,formData);
      this.programTheIssueOf = true;
    },
    // 终端重启
    resetClick(e) {
      if (this.selectionList.length == 0) {
        this.messageText("请选择需要重启的终端");
        return;
      }
      if (!this.judgeWhetherToActivate(this.selectionList)) {
        return;
      }
      this.$confirm("确定重启吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.Operation();
        })
        .catch(() => {});
    },
    judgeWhetherToActivate(e) {
      if(Array.isArray(e)){
        for(let item in e){
          if(e[item].workStatus == 0){
            this.messageText("请选择已激活设备");
            return false;
          }else if (e[item].adStatus !== 1) {
            this.messageText("请选择在线设备");
            return false;
          }
        }
        return true;
      }else{
        if (!e) {
          return false;
        } else if (e.workStatus == 0) {
          this.messageText("请选择已激活设备");
          return false;
        } else if (e.adStatus !== 1) {
          this.messageText("请选择在线设备");
          return false;
        } else {
          return true;
        }
      }
    },
    // 请求发送获取后台发来的截图 重启
    async Operation() {
      let midArray = [];
      let machineCodes = [];
      this.selectionList.forEach((ele) => {
        machineCodes.push(ele.machineCode);
        midArray.push(ele.mid);
      });
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("machineCodes", machineCodes);
      const { data: res } = await this.$http.post(
        "mediaAttribute/clientRestart",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }
      this.currentTableLoad("terminal_publish_table",false);
    },
    // 点击截屏
    ScreenShotClick(e) {
      if (this.selectionList.length == 0) {
        this.messageText("请选择需要截屏的终端");
        return;
      }
      /* if (!this.judgeWhetherToActivate(this.selectionList)) {
        return;
      } */
      this.$confirm("确定截屏吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.ScreenShot();
        })
        .catch(() => {});
    },
    async ScreenShot() {
      let midArray = [];
      let machineCodes = [];
      this.selectionList.forEach((ele) => {
        machineCodes.push(ele.machineCode);
        midArray.push(ele.mid);
      });
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("mids", midArray);
      const { data: res } = await this.$http.post(
        "mediaAttribute/screenshot",
        formData
      );
      this.screenshotList = "";
      if (res.result !== "success") {
        this.messageText(res.message, "error");
        return;
      }
      //处理加载画面
      if(res.data && res.data.length > 0){
        for(let item in res.data){
          res.data[item].loading=true;
        }
        this.screenshotList = res.data;
        this.screenshotShow=true;

        this.is_img_url(res.data);
      }else{
        this.messageText("获取截屏数据为空", "error");
      }
      //this.imgurlNum = 0;

    },
    //判断图片是否存在
    is_img_url(data) {
      //利用image的onload与error事件达到循环验证图片加载的目的
      var that = this;
      let listIndex=0;
      let errorIndex=[];
      let countTime=1;
      /* return new Promise(function (resolve, reject) { */
      var ImgObj = new Image(); //判断图片是否存在
      //预先绑定加载图片的函数
      ImgObj.onload = (res) => {
        let pic_id = res.target.id;
        for(let item in this.screenshotList){
          if(this.screenshotList[item].mid == pic_id){
            this.screenshotList[item].loading = false;
            break;
          }
        }
        if(listIndex < this.screenshotList.length-1){
          listIndex++;
          ImgObj.src = data[listIndex].path;
          ImgObj.id = data[listIndex].mid
        }else{
          if(errorIndex.length > 0){//还存在加载失败的 暂停3秒再继续加载
              countTime++;
              if(countTime < 10){
                setTimeout(() => {
                    listIndex=0;
                    errorIndex=[];
                    ImgObj.src = data[listIndex].path;
                    ImgObj.id = data[listIndex].mid;

                }, 2000);
              }else{
                this.messageText("终端截屏加载超时请重新开始或点击刷新", "error");
              }
          }
        }
        //成功后继续执行的方法
        /*  resolve(res); */
      };
      //预先绑定图片加载失败的函数
      ImgObj.onerror = (err) => {
        let pic_id = err.target.id;
        for(let item in this.screenshotList){
          if(this.screenshotList[item].mid == pic_id){
            this.screenshotList[item].loading = true;
          }
        }
        errorIndex.push(listIndex);
        if(listIndex < this.screenshotList.length-1){
          listIndex++;
          ImgObj.src = data[listIndex].path;
          ImgObj.id = data[listIndex].mid
        }else{
          if(errorIndex.length > 0){//还存在加载失败的 暂停3秒再继续加载
            countTime++;
            if(countTime < 10){
              setTimeout(() => {
                  listIndex=0;
                  errorIndex=[];
                  ImgObj.src = data[listIndex].path;
                  ImgObj.id = data[listIndex].mid;

              }, 2000);
            }else{
              this.messageText("终端截屏加载超时请重新开始或点击刷新", "error");
              //激活手动刷新
              //ImgObj.src = data[listIndex].path;
              ImgObj.id = data[listIndex].mid;
              //this.screenshotList[listIndex].loadouttime = true;
              this.screenshotList[listIndex].loading = false;
            }
          }
        }

          //失败后继续执行的方法
         /*  reject(err); */
      };
      ImgObj.src = data[0].path;
      ImgObj.id = data[0].mid

      /* }).catch((e) => {}); */ // 加上这句不会报错（Uncaught (in promise)）
    },
    screenShotRefresh(pic){//当图片加载不全时  可点击图片来再次刷新
      if(pic && (!pic.loading || pic.loadouttime)){
         for(let item in this.screenshotList){
          if(this.screenshotList[item].mid == pic.mid){
            this.screenshotList[item].path = this.screenshotList[item].path.split("?")[0]+'?'+Math.random();//加随机数重新加载
            break;
          }
        }
      }
    },
    // 清理过期文件
    scratchFile() {
      this.clearScratchFileAxios();
      this.LogDetailsTable = [];
      this.runningLogList();
    },
    // 提交终端日志详情
    async UpTerminalLogDetails() {
      if (!this.logForm.clientName) {
        this.messageText("终端名称不能为空");
        return;
      }
      if (!this.logForm.cleanFileDay) {
        this.messageText("清理天数");
        return;
      }
      for (const key in this.logForm) {
        if (!this.logForm[key]) {
          this.logForm[key] = "";
        }
      }
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("mid", this.logForm.mid);
      formData.append("machineCode", this.logForm.machineCode);
      formData.append("clientName", this.logForm.clientName);
      formData.append("cleanFileDay", this.logForm.cleanFileDay);
      formData.append("light", this.logForm.light);
      formData.append("voice", this.logForm.voice);
      formData.append("ftpId", this.logForm.ftpId);
      formData.append("downloadStartTime", this.logForm.loadEndTime[0]);
      formData.append("downloadEndTime", this.logForm.loadEndTime[1]);
      formData.append("workStartTime", this.logForm.workStartTime);
      formData.append("workEndTime", this.logForm.workEndTime);
      formData.append("netType", this.logForm.netType);
      const { data: res } = await this.$http.post(
        "mediaAttribute/updateMedia",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }
      this.LogDetails = false;
      this.logForm = {};
      this.currentTableLoad("terminal_publish_table",false);
    },
    // 限制最大音量
    MaximumVolume() {
      let light = 100;
      if (this.logForm.maxVoice) {
        if (this.logForm.voice > this.logForm.maxVoice) {
          this.messageText("音量不能超过" + this.logForm.maxVoice);
          return;
        }
      }
      if (this.logForm.light) {
        if (this.logForm.light > light) {
          this.messageText("亮度不能超过" + light);
          return;
        }
      }
    },
    // 点击升级按钮
    async upgradeTerminal() {
      if (this.selectionList.length == 0) {
        this.messageText("请选择终端数据");
        return;
      }
      if (!this.judgeWhetherToActivate(this.selectionList)) {
        return;
      }
      let formData = new FormData();
      formData.append("auditStatus", 1);
      this.currentTableLoad("select_apk_table",true,formData);
      this.upgradeDialog = true;
    },
    //同步终端时间
    async syncClientTime(){
      if (this.selectionList.length == 0) {
        this.messageText("请选择终端数据");
        return;
      }
      /* if (!this.judgeWhetherToActivate(this.selectionList)) {
        return;
      } */
      let machineCodes = [];
      this.selectionList.forEach((ele) => {
        machineCodes.push(ele.machineCode);
      });
      let formData = new FormData();
      formData.append("machineCodes", machineCodes);
      const { data: res } = await this.$http.post(
        "mediaAttribute/syncClientTime",
        formData
      );
      if (res.result == "success") {
        this.messageText("发送同步时间指令成功", "success");
      } else {
        this.messageText(res.message, "error");
      }

    },
    //同步全网终端时间
    async syncAllClientTime(){
      let formData = new FormData();
      const { data: res } = await this.$http.post(
        "mediaAttribute/syncAllClientTime",formData
      );
      if (res.result == "success") {
        this.messageText("发送同步所有终端时间指令成功", "success");
      } else {
        this.messageText(res.message, "error");
      }
    },
    // 提交更新的名单
    async SubmitTheUpdates() {
      if (!this.upgradeSelectList || !this.upgradeSelectList.materialId) {
        this.messageText("请选择其中一个升级包");
        return;
      }
      let array = [];
      this.selectionList.forEach((ele) => {
        array.push(ele.machineCode);
      });
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("materialId", this.upgradeSelectList.materialId);
      formData.append("machineCodes", array);
      const { data: res } = await this.$http.post(
        "mediaAttribute/mediaUpgrade",
        formData
      );
      if (res.result == "success") {
        this.$message({
          type: "success",
          message: res.message,
        });
      } else {
        this.$message({
          type: "error",
          message: res.message,
        });
      }
      this.upgradeDialog = false;
    },
    // 获取勾选更新名单
    handleSelectionChange(val) {
      if (val.length > 1) {
        this.$refs.zdxxTab.clearSelection();
        this.$refs.zdxxTab.toggleRowSelection(val[val.length - 1]);
      }
      this.upgradeSelectList = [];
      this.upgradeSelectList.push(val[val.length - 1]);
    },
    // 终端日志详情
    async TheTerminalDetails(row) {
      if(!row || !row.mid){
        this.messageText("获取终端数据异常");
        return;
      }
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("mid", row.mid);
      const { data: res } = await this.$http.post(
        "mediaAttribute/selectByPrimaryKey",
        formData
      );
      if (res.data.ftpId == 0) {
        res.data.ftpId = "";
      }
      let loadEndTime = [];
      if (res.data.downloadEndTime && res.data.downloadStartTime) {
        loadEndTime.push(res.data.downloadStartTime);
        loadEndTime.push(res.data.downloadEndTime);
      }
      let loadWorkTime = [];
      if (res.data.workStartTime && res.data.workEndTime) {
        loadWorkTime.push(res.data.workStartTime);
        loadWorkTime.push(res.data.workEndTime);
      }
      res.data.loadEndTime = loadEndTime;
      res.data.loadWorkTime = loadWorkTime;
      this.logForm = res.data;
      let fd = new FormData();
      fd.append("machineCode", this.logForm.machineCode);
      this.currentTableLoad("media_run_log_table",true,fd);
      this.LogDetails = true;
    },
    // 获取运行日志
    async runningLogList() {
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("machineCode", this.logForm.machineCode);
      let url = "runLog/selectPage";
      this.query1.page = this.query1.page ? this.query1.page : 1;
      this.query1.pageSize = this.query1.pageSize ? this.query1.pageSize : this.GlobalVar.query.pageSize;
      if (this.upgradeDialog) {
        url = "material/selectApk";
        formData.append("page", this.query1.page);
        formData.append("pageSize", this.query1.pageSize);
      } else if (this.activeName == "third") {
        url = "runLog/selectPage";
        formData.append("page", this.query1.page);
        formData.append("pageSize", this.query1.pageSize);
      } else if (this.activeName == "fourth") {
        url = "playLog/selectPage";
        formData.append("page", this.query1.page);
        formData.append("pageSize", this.query1.pageSize);
      } else if (this.activeName == "file") {
        if (this.selectionList[0].adStatus != 1) {
          this.messageText("终端离线不能获取终端文件数据");
          return;
        }
        url = "mediaAttribute/getClientFile";
      }
      const { data: res } = await this.$http.post(url, formData);
      this.query1.page = res.page == "undefined" ? 1 : res.page;
      this.query1.pageSize = res.pageSize == "undefined" ? 1 : res.pageSize;
      this.query1.total = res.total;
      if (this.activeName == "file" && !res.data.length) {
        this.LogDetailsTable = res.data;
        this.query1.total = 0;
        this.messageText("终端数据获取延迟请刷新");
        return;
      } else if (this.activeName == "file") {
        this.query1.page = 1;
        this.query1.pageSize = this.GlobalVar.query.pageSize;
        this.LogDetailsTable = res.data;
        this.query1.total = res.data.length;
      } else {
        this.LogDetailsTable = res.dataList;
      }
    },
    handleSizeVue(val) {
      this.query1.pageSize = val;
    },
    handleCurrentVue(val) {
      this.query1.page = val;
    },
    // 勾选的终端数据
    HomehandleSelection(selection, row) {
      this.logForm.clientName=row.clientName
      this.selectionList = selection;
    },
    // 删除时间段表格中的数据
    RemovePalyTiem(row) {
      let array = [];
      this.palyTiemTable.forEach((ele, index) => {
        if (index !== row.$index) {
          array.push(ele);
        }
      });
      this.palyTiemTable = array;
    },
    // 获取节目详情
    async showPopover(row) {
      this.division = this.Invoking.programSize(row);
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("programId", row.programId);
      formData.append("openLoading", 0); //不启用loading效果
      const { data: res } = await this.$http.post(
        "program/selectByProgramId",
        formData
      );
      res.data.layout.forEach((ele) => {
        ele.height = ele.height / this.division;
        ele.width = ele.width / this.division;
        ele.x = ele.x / this.division;
        ele.y = ele.y / this.division;
        ele.areaInfo = this.Invoking.Confirm(ele.areaType);
      });
      this.layoutData = res.data.layout;
      this.programIdData = res.data;

      if (this.lookProgram && !this.ProgramReleased) {
        this.currentTableLoad("fb_prog_material_table",true);
        this.detailed = true;
        this.terminalList();
      }
    },
    showPopoverRow1(row) {
      if (!this.showPopoverRow) {
        this.showPopoverRow = row;
        this.showPopover(row);
        return;
      }
      if (this.showPopoverRow.programId !== row.programId) {
        this.layoutData = "";
        this.showPopoverRow = "";
        this.showPopoverRow = row;
        this.showPopover(row);
      }
    },
    // 获取终端列表
    async terminalList() {
      let formData = new FormData();
      formData.append("programId", this.programIdData.program.programId);
      this.currentTableLoad("prog_to_media_group_table",true,formData);
    },
    // 分页查询节目信息
    async getProgramList() {
      if (!this.query1.page) {
        this.query1.page = 1;
        this.query1.pageSize = this.GlobalVar.query.pageSize;
      }
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("page", this.query1.page);
      formData.append("pageSize", this.query1.pageSize);
      formData.append("programName", this.ProgramSearch);
      formData.append("auditStatus", 1);
      const { data: res } = await this.$http.post(
        "program/selectPage",
        formData
      );
      this.query1.page = res.page;
      this.query1.pageSize = res.pageSize;
      this.query1.total = res.total;
      this.ProgramList = res.dataList;
      this.ProgramList.forEach((ele) => {
        ele.showPopover = false;
      });
    },
    // 点击打开节目发布
    async ReleaseProgramBtn() {
    /*   if (this.childrenNode.length > 0) {
        this.TreeArray = [];
        if (this.childrenNode[0] != 0) {
          this.TreeArray.push(this.childrenNode[0]);
        }
        this.TreeArraySize = this.TreeArray.length;
      } else {
        if (this.$refs.treeCheck) {
          this.$refs.treeCheck.$refs.treeCheck.setCheckedKeys([]);
        }
      } */
      this.ProgramSearchdata = "";
      this.ProgramReleased = true;
      let fd = new FormData();
      fd.set("auditStatus", 1);
      fd.set("programName", this.ProgramSearchdata);
      this.currentTableLoad("dialog_prog_select_publish_table",true,fd);

       //加载终端组树形数据 注意组件化或必须使用同步方式 不然后续的setCheckedKeys与getCheckedNodes将无效
      await this.treeGetList("dialog");
      //先清理历史数据 再重新自动勾选终端组
      if (this.$refs.treeCheck) {
        this.$refs.treeCheck.$refs.treeCheck.setCheckedKeys([]);
      }
      this.TreeArray = [];
      if (this.childrenNode && this.childrenNode.length > 0) {
        if (this.childrenNode[0] != 0) {
          this.$refs.treeCheck.$refs.treeCheck.setCheckedKeys(this.childrenNode);
          this.$refs.treeCheck.$refs.treeCheck.getCheckedNodes().forEach((element)=>{
            if (element.lastChildren == 1) {
              this.TreeArray.push(element);
            }
          });
        }
      }
      this.TreeArraySize = this.TreeArray.length;
    },
    // 查看终端组节目
    async lookTerminalTable() {
      if (this.childrenNode.length == 0) {
        this.messageText("请选择终端组");
        return;
      }
      let fd = new FormData();
      fd.set("mediaGroupId", this.childrenNode);
      this.currentTableLoad("media_group_prog_table",true,fd);
      //初次生成token uuid
      let timestamp = Date.parse(new Date());
      let uid = window.sessionStorage.getItem("uid");
      this.uuid = timestamp + "_" + uid;
      let token = window.sessionStorage.getItem("token");
      this.token = token;

      //非主终端组显示对应主终端的同步节目单
      this.getMasterGroupInfo(fd);

      this.lookProgram = true;
    },
    async getMasterGroupInfo(fd){
      this.masterGroupId="";
      const { data: res } = await this.$http.post(
        "syncGroupDetails/selectMasterByGroupId",
        fd
      );
      if(res && res.result ==="success"){
        if(res.data){
          if(this.childrenNode != res.data.mediaGroupId){//主终端也不显示查看同步节目
            this.masterGroupId = res.data.mediaGroupId;
            this.masterGroupName = res.data.mediaGroupName;
          }
        }
      }else{
        this.$message.error("加载终端组的同步主终端组信息失败！");
      }
    },
    checkChange(data, a, b) {
      //此方法会触发点击节点上下级相关联的所有节点 每一个节点的变动都会调用一次 需要避免重复执行
      this.TreeArray = [];
      this.$refs.treeCheck.$refs.treeCheck.getCheckedNodes().forEach((element) => {
        if (element.lastChildren == 1) {
          this.TreeArray.push(element);
        }
      });
      this.TreeArraySize = this.TreeArray.length;
    },
    // 点击搜索
    searchInputText(sear_type) {
      let fd = new FormData();
      if (sear_type === 1) {
        //终端列表查询
        fd.set("clientName", this.searchInput);
        this.currentTableLoad("terminal_publish_table",true,fd);
      } else if (sear_type === 2) {
        //节目查询
        if (this.ProgramReleased) {
          fd.set("programName", this.ProgramSearchdata);
          this.currentTableLoad("dialog_prog_select_publish_table",true,fd);
        }
      } else {
        //未知查询参数
        this.messageText("请选择终端组");
      }
    },
    clearInputText() {
      this.ProgramSearch = "";
      this.searchInput = "";
      if (this.ProgramReleased) {
        this.query1.page = 1;
        this.query1.pageSize = this.GlobalVar.query.pageSize;
        this.getProgramList();
        return;
      }
      this.query.page = 1;
      this.query.pageSize = this.GlobalVar.query.pageSize;
      this.thisFormData.set("clientName", "");
      this.tableList();
    },
    // 获取表格
    async tableList() {
      // let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      this.thisFormData.set("zycmToken", token);
      this.thisFormData.set("page", this.query.page);
      this.thisFormData.set("pageSize", this.query.pageSize);
      this.thisFormData.set("mediaGroupId", this.childrenNode);
      //formData.append("clientName", this.advanced.clientName);

      this.thisFormData.set("clientNumber", this.advanced.clientNumber);
      this.thisFormData.set("adStatus", this.advanced.adStatus);
      this.thisFormData.set("netType", this.advanced.ledScreenType);
      this.thisFormData.set("ftpId", this.advanced.ledSize);
      this.thisFormData.set("iccid", this.advanced.maxNum);
      this.thisFormData.set("recordScreenInfo", this.advanced.recordScreenInfo);
      const { data: res } = await this.$http.post(
        "mediaAttribute/selectPage",
        this.thisFormData
      );
      if (res.dataList) {
        res.dataList.forEach((ele) => {
          if (!ele.playProgramNum) {
            ele.playProgramNum = 0;
          } else if (!ele.programNum) {
            ele.programNum = 0;
          }
        });
      }

      this.tableData = res;
      this.query.page = res.page;
      this.query.pageSize = res.pageSize;
      this.query.total = res.total;
    },
    async getProgramTable() {
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("page", this.query2.page);
      formData.append("pageSize", this.query2.pageSize);
      formData.append("mediaGroupId", this.childrenNode);
      const { data: res } = await this.$http.post(
        "publishRecord/selectPage",
        formData
      );

      this.query2.page = res.page;
      this.query2.pageSize = res.pageSize;
      this.query2.total = res.total;
      if (res.dataList) {
        res.dataList.forEach((ele) => {
          this.mediaGroupId = ele.mediaGroupId;
          ele["unionTimeLength"] = ele.unionTime ? ele.unionTime.length : 0;
        });
      }
      this.ProgramTable = res.dataList;
    },
    checkChangeTree(data, checked, node) {
        this.$nextTick(()=>{
          if (this.$refs.treeCheck) {
            this.$refs.treeCheck.$refs.treeCheck.setCheckedKeys([]);
          }
        })
      this.childrenNode = [];

      this.selectionList = [];
      if(data && data.data === ""){
        this.groupData=[];
        this.saveprogram.label = "";
        this.childrenNode=[];
      }else{
        this.groupData = data;
        this.saveprogram.label = data.label;
        this.childrenNode.push(data.data);
      }
      this.tablePageList["terminal_publish_table"].set("mediaGroupId",data.data);
      this.currentTableLoad("terminal_publish_table",true);
    },
    showDetailed() {
      this.detailed = true;
    },
    clickTable(row, index, e) {
      if (this.lookProgram) {
        this.$refs.refTable.toggleRowExpansion(row);
      } else {
        this.$refs.refTable1.toggleRowExpansion(row);
      }
    },
    handleClick(tab, event) {
      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("machineCode", this.logForm.machineCode);
      if(tab.index == 0){//基本信息

      }else if(tab.index == 1){//策略

      }else if(tab.index == 2){//运行日志
        this.currentTableLoad("media_run_log_table",true,formData);
      }else if(tab.index == 3){//播放日志
        this.currentTableLoad("media_play_log_table",true,formData);
      }else if(tab.index == 4){//终端文件
        this.currentTableLoad("get_client_file_table",true,formData);
      }
    },
    async clientHeight() {
      // this.$nextTick(() => {
      //   this.TerminalHeight = this.$refs.boxTheSize.clientHeight - 95;
      // });
      // let formData = new FormData();
      // let uid = window.sessionStorage.getItem("uid");
      // let token = window.sessionStorage.getItem("token");
      // formData.append("zycmToken", token);
      // formData.append("uid", uid);
      // const { data: res } = await this.$http.post(
      //   "mediaGroup/selectGroupTree",
      //   formData
      // );
      // this.data = [res.data];
      this.treeGetList()
    },
    async treeGetList(e) {
      let formData = new FormData();
      let uid = window.sessionStorage.getItem("uid");
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("uid", uid);
      const { data: res } = await this.$http.post(
        "mediaGroup/selectGroupTree",
        formData
      );
      if (e == "dialog") {
        this.data1 = [];
        this.data1.push(res.data);
        this.data1[0]["strictly"] = true;
        this.data1[0]["ifchenck"] = true;
        this.selectTerminal = true;
      } else {
        this.data = [];
        this.data.push(res.data);
      }
    },
    handleSizeChange1(val) {
      if (this.TheExportList) {
        this.query1.pageSize = val;
        this.TheImportProgramClick();
        return;
      }
      this.query3.pageSize = val;
      this.programTheIssueOfSelect();
    },
    handleCurrentChange1(val) {
      if (this.TheExportList) {
        this.query1.page = val;
        this.TheImportProgramClick();
        return;
      }
      this.query3.page = val;
      this.programTheIssueOfSelect();
    },
    // 每页
    handleSizeChange(val) {
      if (this.ProgramReleased) {
        this.query1.pageSize = val;
        this.getProgramList();
        return;
      } else if (this.LogDetails) {
        this.query1.pageSize = val;
        this.TheTerminalDetails();
        return;
      } else if (this.upgradeDialog) {
        this.query1.pageSize = val;
        this.runningLogList();
        return;
      } else if (this.programTheIssueOf) {
        this.query1.pageSize = val;
        this.TheIssueOfClick();
        return;
      } else if (this.chainedAddressDialog) {
        this.query1.pageSize = val;
        this.TheImportProgramClick();
        return;
      } else if (this.TheImportProgram) {
        this.query1.pageSize = val;
        this.TheImportProgramClick();
        return;
      } else if (this.lookProgram && !this.detailed) {
        this.query2.pageSize = val;
        // this.query2.page = 1;
        this.getProgramTable();
        return;
      } else if (this.detailed) {
        this.query1.pageSize = val;
        this.terminalList();
        return;
      }
      this.query.pageSize = val;
      this.tableList();
    },
    // 当前页
    handleCurrentChange(val) {
      if (this.ProgramReleased) {
        this.query1.page = val;
        this.getProgramList();
        return;
      } else if (this.LogDetails) {
        this.query1.page = val;
        this.TheTerminalDetails();
        return;
      } else if (this.upgradeDialog) {
        this.query1.page = val;
        this.runningLogList();
        return;
      } else if (this.programTheIssueOf) {
        this.query1.page = val;
        this.TheIssueOfClick();
        return;
      } else if (this.chainedAddressDialog) {
        this.query1.page = val;
        this.TheImportProgramClick();
        return;
      } else if (this.TheImportProgram) {
        this.query1.page = val;
        this.TheImportProgramClick();
        return;
      } else if (this.lookProgram && !this.detailed) {
        this.query2.page = val;
        this.getProgramTable();
        return;
      } else if (this.lookProgram && this.detailed) {
        this.query1.page = val;
        this.terminalList();
        return;
      }
      this.query.page = val;
      this.tableList();
    },
    //点击到下一步
    NextStepTerminal() {
      if (this.active == 1) {
        if (this.ProgramSelectList.length < 1) {
          this.messageText("请先选择节目");
          return;
        }
        this.ProgramSelectList.forEach((ele) => {
          if (ele.fileNum == 0 || ele.totalSize == 0) {
            this.messageText("请先选择节目");
            return;
          } else {
            this.active = 2;
            this.showReleased1 = true;
            this.showReleased2 = true;
          }
        });
      } else if (this.active == 2) {
        if (this.TreeArray.length < 1) {
          this.messageText("请先选择终端组");
          return;
        }
        this.active = 3;
        this.showReleased2 = false;
        this.showReleased3 = true;
      }

      //清理数据  避免选择发布时间设置后又返回修改节目而引起的绕过验证的问题
      this.Releaseprogram.hhmmss = ["00:00:00", "23:59:59"];
      this.Releaseprogram.weekSet = [];
      this.Releaseprogram.timeQuantum = [];
      this.Releaseprogram.palyRankVal = "普通";
      this.Releaseprogram.tiemSettingVal = "立即下载";
      this.Releaseprogram.palyDuration = 0;
      this.Releaseprogram.several = 0;
      this.Releaseprogram.activeNameProgram = "time";
      this.Releaseprogram.flagPerpetua = true;
      this.palyTiemTable = [
        {
          begin: "00:00:00",
          finish: "23:59:59",
          Number1: "0",
        },
      ];
    },
    // 节目发布的勾选数据
    ProgramSelect(selection, row) {
      this.ProgramSelectList = selection;
    },
    confirmClean() {
      this.palyTiemTable = [];
    },
    // 确定添加到时间预览
    async confirmAdd() {
      //验证输入数据类型
      if (
        this.Releaseprogram.palyDuration != 0 &&
        (!this.Releaseprogram.palyDuration ||
          typeof this.Releaseprogram.palyDuration != "number" ||
          this.Releaseprogram.palyDuration.toString().indexOf(".") >= 0 ||
          this.Releaseprogram.palyDuration < 0)
      ) {
        this.messageText("分钟值不能为空且必须是整数");
        return;
      }
      if (
        this.Releaseprogram.several != 0 &&
        (!this.Releaseprogram.several ||
          typeof this.Releaseprogram.several != "number" ||
          this.Releaseprogram.several.toString().indexOf(".") >= 0 ||
          this.Releaseprogram.several < 0)
      ) {
        this.messageText("次数值不能为空且必须是整数");
        return;
      }
      //验证日期选择
      if (
        this.Releaseprogram.activeNameProgram == "time" &&
        !this.Releaseprogram.flagPerpetua &&
        this.Releaseprogram.timeQuantum.length == 0
      ) {
        this.messageText("请选择播放的日期");
        return;
      } else if (
        this.Releaseprogram.activeNameProgram == "frame" &&
        this.Releaseprogram.timeQuantum.length == 0
      ) {
        this.messageText("请选择定时连播的日期");
        return;
      } else if (
        this.Releaseprogram.activeNameProgram == "week" &&
        this.Releaseprogram.weekSet.length == 0
      ) {
        this.messageText("请选择播放的星期");
        return;
      }

      //验证时分秒
      if (
        !this.Releaseprogram.hhmmss ||
        this.Releaseprogram.hhmmss.length == 0
      ) {
        this.messageText("请选择播放时间的时分秒时段");
        return;
      }

      //验证是否与已增加的时段存在冲突
      let start_long = new Date(
        "1970-01-01 " + this.Releaseprogram.hhmmss[0]
      ).getTime();
      let end_long = new Date(
        "1970-01-01 " + this.Releaseprogram.hhmmss[1]
      ).getTime();
      for (let item of this.palyTiemTable) {
        let start1_long = new Date("1970-01-01 " + item.begin).getTime();
        let end1_long = new Date("1970-01-01 " + item.finish).getTime();
        if (start1_long >= start_long && start1_long <= end_long) {
          this.messageText(
            "添加时段与【" + item.begin + "-" + item.finish + "】存在交叉时段！"
          );
          return;
        }
        if (end1_long >= start_long && end1_long <= end_long) {
          this.messageText(
            "添加时段与【" + item.begin + "-" + item.finish + "】存在交叉时段！"
          );
          return;
        }
        if (start1_long <= start_long && end1_long >= end_long) {
          this.messageText(
            "添加时段与【" + item.begin + "-" + item.finish + "】存在交叉时段！"
          );
          return;
        }
      }

      //算出选中的终端组
      let TreeData = [];
      if (this.childrenNode.length > 0) {
        TreeData.push(this.childrenNode[0]);
      }
      this.TreeArray.forEach((ele) => {
        if (ele.data && ele.data !== this.childrenNode[0]) {
          TreeData.push(ele.data);
        }
      });

      //验证输入的分钟及次数是否合法
      if (this.Releaseprogram.several * 1 > 0) {
        //存在限次
        //算出选择的节目的总播放时长
        let total_t = 0;
        this.ProgramSelectList.forEach((ele) => {
          total_t += ele.totalPlayTime;
        });

        let maxPlayTime = 0,
          maxProgListTime = 0;
        let maxPlayTimeGroupname = "",
          prefixstr = "";
        if (this.Releaseprogram.activeNameProgram == "frame") {
          //定时连播时 算一轮播放的时间 直接就是选择的单个或多个节目的总时长
          maxProgListTime = total_t;
          prefixstr =
            "当前选择的将要发布的单个或多个节目的总时长" +
            total_t +
            "秒,也就是说每" +
            total_t +
            "秒才会播一次当前发布的每个节目。";
        } else {
          //其他播放模式都是属于循环播放  算一轮播放的时间 是选择的终端组中最大的节目单总时长 + 当前选择的将要发布的单个或多个节目的总时长
          //查出终端组中最长的节目总时长
          let param1 = new FormData();
          param1.append("mediaGroupIds", TreeData.join());
          const { data: res } = await this.$http.post(
            "publishRecord/selectMaxPlayTime",
            param1
          );
          if (res.result == "success") {
            maxPlayTime = res.data.maxPlayTime * 1;
            maxPlayTimeGroupname = res.data.mediaGroupName;
          } else {
            this.messageText(res.message, "error");
          }

          //算出能保证每个节目都会播放的时长 = 选择的终端组中最大的节目单总时长 + 当前选择的将要发布的单个或多个节目的总时长
          maxProgListTime = maxPlayTime + total_t;
          prefixstr =
            "选择的终端组中最大的节目单总时长" +
            maxPlayTime +
            "秒【" +
            maxPlayTimeGroupname +
            "】，再加上当前选择的将要发布的单个或多个节目的总时长" +
            total_t +
            "秒,也就是说每" +
            (maxPlayTime + total_t) +
            "秒才会播一次当前发布的每个节目。";
        }

        //算出时段内的毫秒数
        let dif = end_long - start_long;
        if (
          this.Releaseprogram.palyDuration == 0 &&
          this.Releaseprogram.several * maxProgListTime * 1000 > dif
        ) {
          this.messageText(
            prefixstr +
              "所以在" +
              dif / 1000 +
              "秒内不能播放" +
              this.Releaseprogram.several +
              "次,最多只能播放" +
              parseInt(dif / 1000 / maxProgListTime) +
              "次。"
          );
          return;
        } else {
          //分钟值与次数都不为空时的处理
          if (dif < this.Releaseprogram.palyDuration * 60 * 1000) {
            this.messageText("选择的时分秒时间段不能小于间隔的分钟值！");
            return;
          }

          if (maxProgListTime > this.Releaseprogram.palyDuration * 60) {
            this.messageText(
              prefixstr + "所以分钟值必须大于" + maxProgListTime + "秒。"
            );
            return;
          }

          if (
            this.Releaseprogram.several * maxProgListTime >
            this.Releaseprogram.palyDuration * 60
          ) {
            this.messageText(
              prefixstr +
                "所以每" +
                this.Releaseprogram.palyDuration +
                "分钟不能播放" +
                this.Releaseprogram.several +
                "次,最多只能播放" +
                parseInt(
                  (this.Releaseprogram.palyDuration * 60) / maxProgListTime
                ) +
                "次。"
            );
            return;
          }
        }

        //根据时间段判断选中的这些组中是否存在交叉时间段的其他按次的播放设置
        let param2 = new FormData();
        param2.append("mediaGroupIds", TreeData.join());
        if (
          this.Releaseprogram.flagPerpetua &&
          (!this.Releaseprogram.timeQuantum ||
            this.Releaseprogram.timeQuantum.length === 0)
        ) {
          param2.append(
            "startDate",
            this.$options.filters.dateFormat(new Date().getTime())
          );
          param2.append(
            "endDate",
            this.$options.filters.dateFormat(new Date("2199-01-01").getTime())
          );
        } else {
          param2.append("startDate", this.Releaseprogram.timeQuantum[0]);
          param2.append("endDate", this.Releaseprogram.timeQuantum[1]);
        }
        param2.append("startTime", this.Releaseprogram.hhmmss[0]);
        param2.append("endTime", this.Releaseprogram.hhmmss[1]);
        const { data: res1 } = await this.$http.post(
          "publishRecord/selectConflictTime",
          param2
        );
        if (res1.result == "success") {
          if (res1.data.length > 0) {
            //this.messageText("选择的终端组存在冲突的时间段"+res1.data.length, "error");
            this.conflictTimeList = res1.data;
          } else {
            //没有冲突
            //循环批量生成区间
            var xhnum = parseInt(
              dif / (this.Releaseprogram.palyDuration * 60 * 1000)
            );
            if (xhnum > 720) {
              this.messageText(
                "最多添加720个时段,建议不要使用太多时段，设置时段越多广告播放的处理时间越长！"
              );
              return;
            }
            let start_tmp, end_tmp;
            for (var tt = 0; tt < xhnum; tt++) {
              debugger;
              if (tt == 0) {
                start_tmp =
                  start_long +
                  tt * (this.Releaseprogram.palyDuration * 60 * 1000);
                end_tmp =
                  start_long +
                  (tt + 1) * (this.Releaseprogram.palyDuration * 60 * 1000);
              } else {
                start_tmp =
                  start_long +
                  (tt * (this.Releaseprogram.palyDuration * 60 * 1000) + 1000);
                end_tmp =
                  start_long +
                  (tt + 1) * (this.Releaseprogram.palyDuration * 60 * 1000);
              }
              this.palyTiemTable.push({
                begin: this.zycmUtils.dateFormatHMS(start_tmp),
                finish: this.zycmUtils.dateFormatHMS(end_tmp),
                Number1: this.Releaseprogram.several,
              });
            }
          }
        } else {
          this.messageText(res1.message, "error");
        }
      } else if (this.Releaseprogram.several * 1 === 0) {
        //不限次
        if (this.Releaseprogram.palyDuration != 0) {
          this.messageText(
            "不限次时，间隔分钟值将不起作用！请修改次数值大于0或修改分钟值为0！"
          );
          return;
        }
        //此处只有分钟为0 次数为0时触发
        this.palyTiemTable = [
          {
            begin: this.Releaseprogram.hhmmss[0],
            finish: this.Releaseprogram.hhmmss[1],
            Number1: this.Releaseprogram.several,
          },
        ];
      } else {
        this.messageText("未知限次参数值！");
        return;
      }
    },
    // 确定发布
    async ensureIssue() {
      //验证节目
      let Program = [];
      this.ProgramSelectList.forEach((ele) => {
        Program.push(ele.programId);
      });
      if (Program.length === 0) {
        this.messageText("请选择需要发布的节目");
        return;
      }
      //验证终端组
      let TreeData = [];
      /* if (this.childrenNode.length > 0) {
        TreeData.push(this.childrenNode[0]);
      } */
      this.TreeArray.forEach((ele) => {
        /* if (ele.data && ele.data !== this.childrenNode[0]) {
          TreeData.push(ele.data);
        } */
        TreeData.push(ele.data);
      });
      if (TreeData.length === 0) {
        this.messageText("请选择需要发布的终端组");
        return;
      }
      //验证选择的播放日期
      let timeMode = "";
      if (this.Releaseprogram.activeNameProgram == "time") {
        if (this.Releaseprogram.flagPerpetua) {
          timeMode = 1;
        } else {
          timeMode = 2;
        }
      } else if (this.Releaseprogram.activeNameProgram == "frame") {
        timeMode = 4;
      } else if (this.Releaseprogram.activeNameProgram == "week") {
        timeMode = 3;
      }
      if (
        timeMode == 2 &&
        !this.Releaseprogram.flagPerpetua &&
        (!this.Releaseprogram.timeQuantum ||
          this.Releaseprogram.timeQuantum.length == 0)
      ) {
        this.messageText("请选择播放的日期");
        return;
      } else if (
        timeMode == 3 &&
        (!this.Releaseprogram.weekSet ||
          this.Releaseprogram.weekSet.length == 0)
      ) {
        this.messageText("请选择播放的星期");
        return;
      } else if (
        timeMode == 4 &&
        (!this.Releaseprogram.timeQuantum ||
          this.Releaseprogram.timeQuantum.length == 0)
      ) {
        this.messageText("请选择定时连播的日期");
        return;
      }
      //验证播放时间的选择
      if (this.palyTiemTable.length == 0) {
        this.messageText("请添加播放时间");
        return;
      }
      if (
        this.palyTiemTable.length > 1 &&
        this.Releaseprogram.palyRankVal == "优先播放(不支持时段)"
      ) {
        this.messageText("优先播放不支持多时段设置");
        return;
      } else if (this.Releaseprogram.palyRankVal == "优先播放(不支持时段)") {
        //验证优先节目 如果是优先播放  验证终端组是否已存在优先播放的节目
        let formData1 = new FormData();
        formData1.append("mediaGroupIds", TreeData);
        const { data: res3 } = await this.$http.post(
          "publishRecord/checkFirstProgByMediaGroupId",
          formData1
        );
        if (res3.result == "success") {
          if (res3.data.length > 0) {
            var groupname = "";
            for (var n = 0; n < res3.data.length; n++) {
              groupname += "," + res3.data[n].mediaGroupName;
            }
            this.messageText(
              "选择的终端组【" +
                groupname.substr(1) +
                "】已存在优先播放的节目!",
              "error"
            );
            return;
          }
        } else {
          this.messageText(res3.message, "error");
          return;
        }
      }
      let arr = [];
      this.Releaseprogram.weekSet.forEach((ele) => {
        arr.push(ele + 1);
      });
      this.Releaseprogram.weekSet = arr;
      let palyTiemList = [];
      this.palyTiemTable
        .map(function (obj, index) {
          palyTiemList.push(obj.begin + "#" + obj.finish + "#" + obj.Number1);
          return;
        })
        .join(",");
      palyTiemList = palyTiemList.toString();

      let formData = new FormData();
      let token = window.sessionStorage.getItem("token");
      formData.append("zycmToken", token);
      formData.append("programIds", Program);
      formData.append("mediaGroupIds", TreeData);
      if (!palyTiemList) {
        formData.append("timesetdata", "00:00:00#23:59:59#0");
      } else {
        formData.append("timesetdata", palyTiemList);
      }
      formData.append("timeMode", timeMode);
      formData.append(
        "downloadMode",
        this.Releaseprogram.tiemSettingVal == "立即下载" ? 1 : 2
      );
      formData.append(
        "playLevel",
        this.Releaseprogram.palyRankVal == "普通" ? 1 : 2
      );
      formData.append("weekSet", this.Releaseprogram.weekSet);
      formData.append("switchMode", 1);
      if (this.Releaseprogram.activeNameProgram == "time"
          && this.Releaseprogram.flagPerpetua) {
        //永久的默认填充值
        formData.append(
          "playStartDate",
          this.zycmUtils.dateFormatYMD(new Date().getTime())
        );
        formData.append("playEndDate", "2199-01-01");
      } else {
        formData.append("playStartDate", this.Releaseprogram.timeQuantum[0]);
        formData.append("playEndDate", this.Releaseprogram.timeQuantum[1]);
      }
      formData.append("playStartTime", this.Releaseprogram.hhmmss[0]);
      formData.append("playEndTime", this.Releaseprogram.hhmmss[1]);
      formData.append("frequency", "");
      const { data: res } = await this.$http.post(
        "publishRecord/publishProg",
        formData
      );
      if (res.result == "success") {
        this.messageText(res.message, "success");
      } else {
        this.messageText(res.message, "error");
      }

      this.ProgramReleased = false;
      this.active = 1;
      this.showReleased1 = false;
      this.showReleased2 = false;
      this.showReleased3 = false;
      this.Releaseprogram.weekSet = {};
      this.ProgramSelectList = [];
      this.TreeArray = [];
      this.Releaseprogram.activeNameProgram = "time";
      this.Releaseprogram.flagPerpetua = true;
      this.palyTiemTable = [
        {
          begin: "00:00:00",
          finish: "23:59:59",
          Number1: "0",
        },
      ];

      if(this.lookProgram){
        this.currentTableLoad("media_group_prog_table",false);//刷新当页
      }
      let fd = new FormData();
       fd.set("mediaGroupId", this.childrenNode);
      this.currentTableLoad("terminal_publish_table",true,fd);
    },
    changePalyRankVal() {
      if (this.Releaseprogram.palyRankVal == "优先播放(不支持时段)") {
        this.Releaseprogram.hhmmss = ["00:00:00", "23:59:59"];
        this.Releaseprogram.palyDuration = 0;
        this.Releaseprogram.several = 0;
        this.palyTiemTable = [
          {
            begin: "00:00:00",
            finish: "23:59:59",
            Number1: "0",
          },
        ];
      }
    },
    // 上一步
    LastStepTerminal() {
      if (this.active == 2) {
        this.active = 1;
        this.showReleased1 = false;
        this.showReleased2 = false;
      } else if (this.active == 3) {
        this.active = 2;
        this.showReleased2 = true;
        this.showReleased3 = false;
      }
    },
    // 点击永久
    perpetuaBtn() {
      if (this.Releaseprogram.flagPerpetua) {
        this.Releaseprogram.timeQuantum = "";
      }
    },
    // 点击选择的星期
    ClickHebdomad(e) {
      this.$nextTick(() => {
        this.$refs.program_num.forEach((ele, index) => {
          if (
            (index == e &&
              this.$refs.program_num[index].style.backgroundColor == "") ||
            (index == e &&
              this.$refs.program_num[index].style.backgroundColor ==
                "rgb(255, 255, 255)")
          ) {
            this.Releaseprogram.weekSet.push(e);
            this.$refs.program_num[index].style.backgroundColor = "#4d9ce0";
            this.$refs.program_num[index].style.color = "#fff";
          } else if (
            index == e &&
            this.$refs.program_num[index].style.backgroundColor ==
              "rgb(77, 156, 224)"
          ) {
            let array = this.Releaseprogram.weekSet;
            this.Releaseprogram.weekSet = [];
            array.forEach((ele) => {
              if (ele !== e) {
                this.Releaseprogram.weekSet.push(ele);
              }
            });

            this.$refs.program_num[index].style.backgroundColor = "#fff";
            this.$refs.program_num[index].style.color = "#4d9ce0";
          }
        });
        this.unique(this.Releaseprogram.weekSet);
      });
    },
    // 数组去重
    unique(arr) {
      Array.from(new Set(arr));
      return;
    },
    messageText(e, c) {
      this.$message({
        type: c ? c : "warning",
        message: e,
      });
    },
    //切换终端组的原节目及同步节目
    switchProgramListBtn(){
      let fd = new FormData();
      if(this.showSyncGroupProgBtn === 1){//显示同步节目单
        fd.set("mediaGroupId", this.masterGroupId);
        this.showSyncGroupProgBtn = 0;
      }else{//显示原节目单
        fd.set("mediaGroupId", this.childrenNode);
        this.showSyncGroupProgBtn = 1;
      }
      this.currentTableLoad("media_group_prog_table",true,fd);
    },
  },
};
</script>

<style lang="stylus" scoped>
.detailed {
  .el-tree > .el-tree-node {
    min-width: 100%;
    display: inline-block;
  }
  // 布局
  .TabLayout {
    text-align: center;

    .box {
      border: 1px solid #eee;
      width: 100%;
      min-height: 350px;
      box-sizing: border-box;
      .box_text {
        padding: 5px 0;
      }
      .boxLayou {
        position: relative;
        background-color: #eee;
        margin: 0 auto 0;
        background-color: #2183d8;
        border: 1px solid #2183d8;
        text-align: center;
        .boxLayou_child {
          background-color: #f2faff;
          position: absolute;
          border: 1px solid #2183d8;
          box-sizing: border-box;
          text-align: center;
        }
      }
    }
    /deep/.el-pager li,
    /deep/.el-pagination .btn-next,
    /deep/ .el-pagination .btn-prev {
      border: 1px solid #eee;
      border-radius: 5px;
      margin: 0 5px;
      color: #333;
    }
    /deep/.el-pagination .btn-next {
      padding: 0;
    }
    /deep/.el-pagination .btn-prev {
      padding: 0;
    }
  }
}
.inputCodeName {
  width: 100%;
  /deep/.el-form-item__content {
    display: flex;
    width: 100%;
    .el-input {
      width: 48%;
    }
    .el-input:nth-child(1) {
      margin-right: 4%;
    }
    .el-select{
      .el-input{
        width:200px;
      }
    }
  }
}
.item_select {
  display: flex;
  /deep/.el-select {
    margin-bottom: 20px;
  }
  /deep/.el-select:nth-child(2) {
    margin: 0 10px;
  }
}
.selectTiem {
  width: 100%;
  color: #666;
  float: left;
  input {
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    margin: 0 5px;
    padding-left: 5px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
  }
}
.screenshot_img {
  width: 500px;
  margin-left: 25px;
}
.button_dialog1 {
  border-top: 1px solid #eee;
  padding-top: 20px;
}
.suspension {
  z-index: 1000;
  position: absolute;
}
.Terminal_box {
  height: 100vh;
    overflow-x: hidden;
  .BgColor {
    //background-color: #e4f2ff;
    height: 100%;
  }
  // /deep/.el-table{
  //   border: 1px solid #ccc;
  // }
  .tltle_box {
    margin: 20px 20px 0 0;
    background-color: #fff;
    // display: flex;
    // justify-content: space-between;
    height: 10vh;
    width: 97%;
    // align-items: center;
    margin-bottom: 20px;
    border-radius: 6px;
    .tltle_box_btn {
      padding: 0 2.5%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 95%;
      height: inherit;
      .el-button {
        background-color: #f2faff;
        min-width: 55px;
        height: 55px;
        border: none;
        margin-left: 0;
        // margin: 0 5px;
        padding: 0 5px;
        border-radius: 5px;
        font-size:12px;
        img {
          width: 26px;
          height: 26px;
        }
      }
      /deep/.el-button:hover {
        background-color: #f2f2f2;
      }
    }
    .tltle_box_input {
      width: 100%;
      float: left;
      padding-left: 20px;

      /deep/.el-input__inner {
        border-radius: 0;
        border-radius: 4px;
        // border-bottom-left-radius: 4px;
      }
      /deep/.el-input {
        width: 20%;
      }
      display: flex;
      margin-left: 20px;
      .input_button /deep/.el-button {
        border-radius: 0;
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
      }
      /deep/.el-button {
        margin: 0 20px 0 0;
        height: 40px;
        margin-left: 20px;
        background-color: #2183d8;
      }
    }
    /deep/.el-table th,
    .el-table tr {
      background-color: #fafafa;
    }
  }
  .refresh_box {
    display: flex;
    margin: 0 1% 0;
    .refresh {
      background-color: #fff;
      color: #2183d8;
      margin: 10px 0 0 20px;
    }
    // .refreshFor{
    //    margin: 20px 0 0 20px;
    // }
    .refreshFor {
      display: flex;
      margin: 10px 0 0 20px;
      .el-tag {
        max-width: 120px;
        height: 40px;
        line-height: 40px;
        overflow: hidden;
        margin-right: 10px;
        /deep/.el-icon-close {
          top: -15px;
        }
        .refreshFor_li_text {
          display: inline-block;
          max-width: 80px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }
    }
  }
  .onlineData {
    //padding-left: 10px;
    min-width: 350px;
    span {
      display: inline-block;
      line-height: 40px;
      padding-right: 10px;
      .f9a174 {
        color: "#f9a174";
      }
    }
  }
  .Terminal_table {
    //margin: 1.5% 1.5% 0 0;
    width: 97%;
    background-color: #fff;
    border-radius: 6px;
    height: 72vh;
    .Terminal_table_input {
      display: flex;
      width: 35%;
      padding: 20px 0 0 20px;
      margin: 0 1% 0;
      .button1 {
        margin: 0 10px;
        display: inline-block;
      }
      /deep/.el-input {
        min-width: 150px;
      }
      /deep/.el-input__inner {
        min-width: 150px;
      }
      .refreshFor {
        display: flex;
        margin: 0 10px;
        .el-tag {
          max-width: 120px;
          height: 40px;
          line-height: 40px;
          overflow: hidden;
          margin-right: 10px;
          /deep/.el-icon-close {
            top: -15px;
          }
          .refreshFor_li_text {
            display: inline-block;
            max-width: 80px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
        }
      }
    }
    .el-table {
      margin: 1%;
      width: 97%;
      // padding: 20px;
    }
  }
  .Terminal_tree {
    padding: 20px 0px 0px 0px;
    .tree_btn {
      display: flex;
      justify-content: space-around;
      align-items: center;
      width: 100%;
      height: 80px;
      border-radius: 6px;
      //border: 1px dashed #ccc;
      background-color: #fff;
      margin-bottom: 20px;
      .el-button {
        min-width: 50px;
        height: 50px;
        border: none;
        margin-left: 0;
        // margin: 0 5px;
        padding: 0 5px;
        border-radius: 5px;
        font-size:12px;
        background-color: #f2faff;
        img {
          width: 26px;
          height: 26px;
        }
      }
    }
  }
  .detailed /deep/.el-tab-pane{
    height: 400px;
    overflow-y: scroll;
}
  /deep/.el-tree {
    //background-color: #e4f2ff;
    background-color: #cce3f9;
  }
  .pagination {
    display: flex;
    height: 60px;
    justify-content: center;
  }
  /deep/.el-pager li,
  /deep/.el-pagination .btn-next,
  /deep/ .el-pagination .btn-prev {
    border: 1px solid #eee;
    border-radius: 5px;
    margin: 0 5px;
    color: #333;
    padding: 0;
  }
  /deep/.el-pager li.active {
    background-color: #2183d8;
    color: #fff;
  }
  /deep/.el-pagination__sizes {
    //padding-left: 20px;
  }
  .fold {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }
  .fold /deep/.el-form-item__label {
    color: #0095fb;
  }
  .fold /deep/.el-form-item {
    min-width: 20%;
  }
}
/deep/.el-table th,
.el-table tr {
  background-color: #fafafa;
}
// 弹框样式
/deep/.el-dialog {
  /deep/.el-form-item__label{
    margin-top: 1px;
}
  .PreviewStyle {
    img {
      width: 100%;
    }
    video {
      width: 100%;
    }
  }
  .TerminalHead {
    text-align: right;
    .el-button {
      border-radius: 5px;
      min-width:50px
      height:50px;
      background-color: #f2faff;
      border: none;
      padding: 0 5px;
      font-size: 12px;
      margin: 0 5px 10px 0;
      a{
        color:#606266
      }
      img {
        width: 26px;
        height: 26px;
      }
    }
  }
  .thirdlyPhase {
    height: 400px;
    position: absolute;
    left: 0;
    right: -17px;
    top: 0;
    bottom: 0;
    overflow-x: hidden;
    overflow-y: scroll;
    /deep/.el-tabs__nav {
      float: right;
    }
    .byTime {
      width: 100%;
      display: flex;
      .byTime_perpetual {
        cursor: pointer;
        height: 40px;
        width: 70px;
        border: 1px solid #eee;
        box-sizing: border-box;
        border-radius: 5px;
        text-align: center;
        line-height: 40px;
        margin-right: 30px;
        font-size: 14px;
        color: #888;
      }
    }
    .program_ul {
      display: flex;
      justify-content: space-around;
      background-color: #fff;
      li {
        cursor: pointer;
        height: 30px;
        line-height: 30px;
        font-size: 12px;
        width: 70px;
        text-align: center;
        color: #4d9ce0;
        border: 1px solid #4d9ce0;
        border-radius: 3px;
        background-color: #fff;
      }
    }
    .palyTime {
      height: 50px;
      line-height: 50px;
      border-bottom: 1px solid #eee;
    }
    .Select_Option {
      display: flex;
      justify-content: right;
      margin: 10px 0 0;
      /deep/.el-select {
        margin-right: 20px;
      }
    }
    .frequency {
      text-align: center;
      width: 50%;
      line-height: 40px;
      cursor: pointer;
    }
    .transition-box {
      margin-bottom: 10px;
      width: 100%;
      border-radius: 4px;
      color: #fff;
      padding: 20px 0 0;
      box-sizing: border-box;
      margin-right: 20px;
      .hebdomad_head {
        display: flex;
        justify-content: space-between;
         margin-bottom: 10px;
        div:nth-child(1) {
          width: 90%;
        }
        div:nth-child(2) {
          width: 90%;
        }
      }
    }
  }
  /deep/.el-tree {
    background-color: #fff;
    padding: 0 0 5% 10%;
  }
  .step_select {
    overflow: hidden;
    height: 400px;
    /* /deep/.has-gutter .el-checkbox {
      display: none;
    } */
    .tltle_box_input {
      width: 100%;
      float: left;
      //   padding-left: 20px;
      height: 50px;
      border-bottom: 1px solid #eee;
      margin: 10px 0;
      /deep/.el-input__inner {
        border-radius: 0;
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
      }
      /deep/.el-input {
        width: 30%;
      }
      display: flex;
      //   margin-left: 20px;
      .input_button /deep/.el-button {
        border-radius: 0;
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
      }
      /deep/.el-button {
        margin: 0 20px 0 0;
        height: 40px;
        background-color: #2183d8;
      }
      .refresh {
        background-color: #fff;
        color: #2183d8;
      }
    }
  }
  // /deep/.el-steps {
  //   padding: 0 0 15px;
  // }
  .lookProgramText {
    .setting_icon {
      font-size: 20px;
      color: #4d9ce0;
      cursor: pointer;
    }
    /deep/ .el-form-item__label {
      background-color: #fff;
      color: #4d9ce0;
    }
    /deep/.el-table__expanded-cell[class*="cell"] {
      padding: 0;
    }
    .el-form-item {
      margin-bottom: 0;
    }
  }
  /deep/.el-dialog__body {
    padding: 10px 20px;
  }
  .selectWidthInput {
    width: 100%;
    .selectWidthInput_1 {
      width: 65%;
      float: left;
    }
    .selectWidth {
      float: right;
      width: 30%;
    }
  }

  .LogDetails {
    /deep/.el-form-item {
      margin-bottom: 10px;
    }
  }
  .selectTerminal {
    /deep/.el-tree {
      background-color: #fff;
      padding: 0 0 5% 10%;
    }
  }
  /deep/.el-select {
    display: block;
  }
  /deep/.el-dialog__header {
    background-color: #efefef;
    padding: 0;
    line-height: 50px;
    padding-left: 20px;
    color: #333;
    font-size: 16px;
  }
  .LogDetails /deep/.el-form-item__label {
    background-color: #efefef;
    border-radius: 0;
    height: 40px;
    border: 1px solid #dcdfe6;
    border-right: none;
    box-sizing: border-box;
    text-align: center;
    padding-left: 10px;
  }
  /deep/.el-input__inner,
  /deep/.el-textarea__inner {
    border-radius: 0;
  }
  /deep/.el-button {
    //padding: 12px 25px;
  }
  .opinion {
    /deep/.el-form-item__label {
      height: 80px;
      line-height: 80px;
    }
  }
}
.boxLayou {
  position: relative;
  background-color: #eee;
  margin: 0 auto 0;
  background-color: #2183d8;
  border: 1px solid #2183d8;
    text-align: center;

}
  .boxLayou_child {
    background-color: #f2faff;
    position: absolute;
    border: 1px solid #2183d8;
    box-sizing: border-box;
    text-align: center;
    font-size: 12px;
  }
#testTree {
  .el-checkbox .el-checkbox__inner {
    display: none;
  }
  div[role="group"] {
    .el-checkbox .el-checkbox__inner {
      display: inline-block;
    }
  }
}
/deep/.el-tree--highlight-current /deep/.el-tree-node/deep/.is-current>.el-tree-node__content{
   background: #2183d8;
  color: #fff;
}
/deep/.el-tabs--bottom /deep/.el-tabs__item.is-bottom:nth-child(2),
/deep/.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),
/deep/.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),
/deep/.el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  padding-left: 20px;
}
/deep/.el-tree-node > .el-tree-node__children {
  min-width: 100%;
  overflow: inherit;
}
/deep/.el-tabs__item {
  padding: 0 20px;
}
/deep/.el-tabs__active-bar {
  padding: 0 20px;
  left: -20px;
  color: #2183d8;
}
// /deep/.el-tabs__content {
//   min-height: 350px;
// }
/deep/.el-step__title.is-finish {
  color: #edb867;
}
/deep/.is-finish {
  /deep/.el-step__icon {
    background: #0c94c6;
    color: #fff;
    border-color: #0c94c6;
  }
  /deep/.el-step__line-inner {
    border-color: #0c94c6;
  }
}
/deep/.is-process {
  // /deep/.el-step__title.is-process {
  color: #ccc !important;
  font-weight: 400;
  // }
  /deep/.el-step__icon {
    background: #cccccc;
    color: #fff;
    border-color: #cccccc;
  }
  /deep/.el-step__line-inner {
    border-color: #cccccc;
  }
}
/deep/.is-wait {
  /deep/.el-step__icon {
    background: #cccccc;
    color: #fff;
    border-color: #cccccc;
  }
}
/deep/.el-tree--highlight-current
  .el-tree-node.is-current
  > .el-tree-node__content {
  // background: #2183d8;
  // color: #ccc;
}

// /deep/.has-gutter .el-checkbox {
//   display: none;
// }
/deep/.attention_text{
  font-size: 18px;
  font-weight: 700;
  color: #333;
  padding: 10px 0;
  border-bottom: 1px solid #888;
}
</style>
